Re: using "dictionary with attribute-style access" for newform

2007-03-07 Thread Paul Collier
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

GSoC 2007 - Object-Level Caching

2007-05-29 Thread Paul Collier
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/

Re: GSoC 2007 - Object-Level Caching

2007-05-29 Thread Paul Collier
> 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

GSoC 2007 Object-level Caching - Update

2007-06-05 Thread Paul Collier
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

Re: Event based caching

2007-06-11 Thread Paul Collier
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