Ticket #2160 (closed defect: fixed)
[PATCH] Problems when importing SO model.py with no dburi set up
Reported by: | chrisz | Owned by: | faide |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.x bugfix |
Component: | TurboGears | Version: | 1.0.8 |
Severity: | normal | Keywords: | |
Cc: |
Description
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.
Attachments
Change History
Changed 9 years ago by chrisz
-
attachment
somodel.patch
added
Note: See
TracTickets for help on using
tickets.
Patch as described on the turbogears group