[SQLObject] BUG: ForeignKey in another database
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: J-P L. <sql...@si...> - 2003-11-17 23:59:07
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"> <title></title> </head> <body> Hi All,<br> <br> I just switched from v0.4 to v0.51 and my app broke. It looks like there's a bug in the current release. I'm doing this:<br> <br> <u>Common.py<br> </u>__connection__ = PostgresConnection('dbname=common ...')<br> class User(SQLObject):<br> name = StringCol()<br> ...<br> <br> <u>App.py</u><br> __connection__ = PostgresConnection('dbname=app ...')<br> from Common import User<br> <br> class Notes(SQLObject):<br> ...<br> user = ForeignKey('User')<br> ...<br> <br> This use to work and I use to be able to do Notes(1).user.name. Now I get the following error:<br> <br> Traceback (most recent call last):<br> File "../../external/lib/python/SQLObject/SQLObject.py", line 815, in _SO_foreignKey<br> File "../../external/lib/python/SQLObject/SQLObject.py", line 407, in __new__<br> File "../../external/lib/python/SQLObject/SQLObject.py", line 667, in _init<br> File "../../external/lib/python/SQLObject/DBConnection.py", line 306, in _SO_selectOne<br> File "../../external/lib/python/SQLObject/DBConnection.py", line 149, in queryOne<br> File "../../external/lib/python/SQLObject/DBConnection.py", line 72, in _runWithConnection<br> File "../../external/lib/python/SQLObject/DBConnection.py", line 142, in _queryOne<br> psycopg.ProgrammingError: ERROR: Relation "user" does not exist<br> <br> SELECT name, ... FROM user WHERE id = xx<br> <br> Is there another way to do this?<br> <br> Thanks,<br> <br> J-P<br> </body> </html> |