[sqlalchemy] Re: is there a way to add methods to sqlsoup's MappedFoo classes?

2010-11-17 Thread J
hmm... but i was thinking of having specialized methods for every table/object. am i missing something from your suggestion? how would you have a base class that would somehow specialize depending on the child object? i went ahead and executed my mixin idea by attacking the db._cache dict with

Re: [sqlalchemy] Re: is there a way to add methods to sqlsoup's MappedFoo classes?

2010-11-17 Thread Michael Bayer
On Nov 17, 2010, at 4:05 PM, J wrote: hmm... but i was thinking of having specialized methods for every table/object. am i missing something from your suggestion? No, SqlSoup only offers the base class for all objects as an option. Here's a patch you can try: diff -r 67d8f4e2fcb9

[sqlalchemy] Re: is there a way to add methods to sqlsoup's MappedFoo classes?

2010-11-17 Thread J
to get this working, i had to add a line to clear the cache entry for attr if the base argument was passed in: def entity(self, attr, schema=None, base=None): if base: del self._cache[attr] # ADDED LINE try: t = self._cache[attr] except KeyError, ke: