Re: [SQLObject] eagerly fetching joined objects
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2011-07-21 17:36:03
|
On Thu, Jul 21, 2011 at 10:32:08AM +0200, Simon Cross wrote: > I encountered a similar need in one of my own projects and wrote a > caching version of RelatedJoin that you could probably take ideas from > for a caching version of MultipleJoin / ForeignKey. You can find the > code at http://sutekh.svn.sourceforge.net/viewvc/sutekh/trunk/sutekh/sutekh/core/CachedRelatedJoin.py?revision=2873&view=markup. > I considered contributing it back to SQLObject but it's a bit finicky > to use -- one has to manually initialize the cache (see init_cache It would be an interesting additions even if it's not suitable for the SQLObject core. I can add it to sqlobject/include if you document it and add an example or even better - a test. > method) and then flush the cache (flush_cache) or just particular SQLObject usually uses the word "clear" instead of flush. ;-) > items (invalidate_cache_item) from within one's application as needed. Populating/clearing the cache is too application-specific, it'd be hard to program a universal solution. But if there is a documented API for applications to use - no problem. Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |