[SQLObject] Creating new tables at run time.
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: maxwell h. <no...@ms...> - 2004-02-16 08:47:49
|
I have searched the previous postings on this list, and have searched the
docs and maybe i do not under stand but anyway here is what i would like to
do.
in the example u have
class Person(SQLObject):
firstName = StringCol(length=100)
middleInitial = StringCol(length=1, default=None)
lastName = StringCol(length=100)
and i can create a table named person
but since it is defined as a class the name of the table is "static"
what i would like to do is create many tables at "runtime" which have
exactly the same properties as class Person, but would have different table
names
ie
Arizona=Person(TableName)
Arizona.createTable()
and then i could go Arizona.new(.....) which would a insert a row into what
ever Arizona's Table name is called.
Anyway if this makes sense then i would be greatful :)
Thanx
John
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
|