Ticket #2160 (closed defect: fixed)
[PATCH] Problems when importing SO model.py with no dburi set up
|Reported by:||chrisz||Owned by:||faide|
You cannot import a model.py file for SQLObject that includes inheritance (such as the one below) from outside TurboGears or when no dburi is set up, as reported on the TG group here; you will get a 'No database configuration found!' error:
from sqlobject import SQLObject, StringCol from turbogears.database import PackageHub __connection__ = PackageHub('test') class data(SQLObject): item = StringCol() class deleted_data(data): time = DateTimeCol()
I have attached a simple fix that solves the problem (for an explanation, see the discussion thread above). It should be applied to all TG 1.x versions.