RE: [SQLObject] Dynamical changing of table names
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Jennings J. L C. 46 SK/C. <jar...@eg...> - 2005-11-22 20:28:05
|
> Hello! > > I am having some trouble with setting the table names dynamically > (i.e. on runtime). > The thing I am trying to do is: > MenuItem.sqlmeta.table = 'test_menuitem' > or > MenuItem._table = 'test_menuitem' > > But those changes don't seem to change the working table (SQLObjects > still uses the default table). The things you set in sqlmeta only matter when the class is constructed (i.e. right at the end of the class's block during run time). If you want to test, the easiest thing I've found is to create another database to test with, which has all the same tables as the real database; then change the connection string you use to connect to the test database instead of the real one when you're testing. |