Re: [SQLObject] specify an ordering of columns (not on query results)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Daniel F. <fet...@go...> - 2011-02-14 10:21:29
|
>>> >> Now that we are at it I was wondering whether >>> >> something similar could be adopted for tables too. The order in which >>> >> the tables are defined, class table1( SQLObject ), class table2( >>> >> SQLObject ), etc, etc, could also be significant and one might want >>> >> to >>> >> remember this ordering. And since there is all sorts of metaclass >>> >> trickery involved with class creation, maybe the ordering could be >>> >> stored. >>> >> >>> >> What do you think? >>> > >>> > Yes, it could be done in a metaclass or in the constructor. >>> >>> As far as I can see declarative.DeclarativeMeta is the place to look. >>> I'll try to come up with something. >> >> DeclarativeMeta is a generic metaclass. SQLObject-specific metaclass >> should become its descendant. I suppose you don't need to have >> .creationOrder attribute in all classes (sqlmeta?) Yes, you are right, I'll probably need to subclass DeclarativeMeta, add the creationOrder in this subclassed metaclass and use this sublassed metaclass for SQLObject only. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown |