>> >> 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.
>
> Actually I started to think .creationOrder if the tables is not that
> interesting because it depends on the order of import. The order of
> columns is more interesting and more stable.
You mean that somebody might define his/her tables in several files?
That's certainly a possibility.
I always define my tables in a single file and the order in which they
are defined in that particular file is usually relevant (most
important tables come first, related ones come after each other, etc).
So I thought this information could be usefully stored. But you are
right it's not a robust thing if someone defines tables in various
files in which case creation order will depend on the order of
importing.
Cheers,
Daniel
--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
|