How about:
def filter_keys(hash, keys):
# I'm convinced there must be a better way to write this
return dict([ item for item in hash.iteritems() if item[0] in
keys ])
def save(self):
Blog.objects.create(**filter_keys(self.clean_data, ['name',
'description'])
Although I can often omit
code applies directly to a Django project I've
been working on for the last while, so I have the motivation to
maintain this project wherever it may go!
Thanks,
Paul Collier
[1] http://gdub.wordpress.com/
[2] http://code.djangoproject.com/wiki/
> If I update o1 in some other part of the
> code, what assumptions are made about qs?
Hmm, yeah... I haven't focused enough attention on .cache_set() yet,
heheh. I was definitely just going to implement (1) first, and then
worry about something more advanced once I got to the "smart"
functionalit
Hello! (Internet is acting up; I hope this doesn't double-post.)
It's been a week since coding started. In the meantime I've been
fleshing out the interface for the new QuerySet and incorporating
suggestions from last week. I implemented a 'registry' that tracks
cached QuerySets and listens for i
Hello Henrik!
(I think this has to do with what you're trying to accomplish, correct
me if wrong ;) In terms of keeping cache synced with data in models,
this is something I'm trying to address with my GSoC project for the
summer[1]. In fact, the current code already has a mechanism for
tracking