Re: [SQLObject] specify an ordering of tables
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2011-02-14 09:47:56
|
On Mon, Feb 14, 2011 at 09:58:24AM +0100, Gregor Horvath wrote: > > Oops, dammit, a classical wrong way of thinking. __init__ is about > > creating *rows*, and you certainly is thinking about *classes*. So the > > only right way to go is a metaclass. > > I've done a similar thing for other classes (not SQLObject) with > DeklaraticeMeta from SQLObject: > > classnr = 0 > > class Base(object): > __metaclass__ = declarative.DeclarativeMeta > def __classinit__(cls, newattrs): > log.debug("%s.__classinit__" % cls) > global classnr > classnr = classnr + 1 __classinit__, but of course! Thank you for reminding! Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |