Christopher Arndt schrieb:
> When I quickstart an app with an Elixir identity model (i.e. "tg-admin
> quickstart -i" on 1.1. or "tg-admin quickstart -e -i" on 1.0), I get the
> following exception
> File
> "/home/chris/lib/tgdev11-py25/lib/python2.5/SQLAlchemy-0.3.10-py2.5.egg/sqlalchemy/schema.py",
> line 1274, in _get_engine
> raise exceptions.InvalidRequestError("This SchemaItem is not
> connected to any Engine or Connection.")
I found out that this is caused by an unclean import generated by the
quickstart model.py:
from sqlalchemy import *
from turbogears.database import metadata, session
from elixir import *
Here, "metadata" from the exlixir import shadows "metadata" from the
import above. This "metadata" object is not connected to a database.
As a quick fix, which I implemented in r3378 and r3375, you can move the
Elixir import up one line:
from sqlalchemy import *
from elixir import *
from turbogears.database import metadata, session
This is a bit unclean, since the "metadata" object from
turbogears.database is in turn imported from activemapper, which will go
away at some point. turbogears/database.py should provide the correct
metadata object, depending on which sqlalchemy extension is used.
Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---