It appears that the following line is needed but not included in the
model when quickstarting a project with sqlalchemy and identity:
from sqlalchemy.ext.assignmapper import assign_mapper
The following is what I tried. I create a new project using:
tg-admin quickstart --sqlalchemy --identity identity_test
I then then try to create the tables in my database for identity using:
tg-admin sql create
and get the following error:
Creating tables at sqlite:///devdata.sqlite
Traceback (most recent call last):
File "C:\Python24\Scripts\tg-admin-script.py", line 7, in ?
sys.exit(
File
"c:\python24\lib\site-packages\TurboGears-1.0b2-py2.4.egg\turbogears\comm
and\base.py", line 358, in main
command.run()
File
"c:\python24\lib\site-packages\TurboGears-1.0b2-py2.4.egg\turbogears\comm
and\base.py", line 115, in run
sacommand(command, sys.argv)
File "<string>", line 5, in sacommand
File
"c:\python24\lib\site-packages\TurboGears-1.0b2-py2.4.egg\turbogears\comm
and\base.py", line 69, in sacreate
get_model()
File
"c:\python24\lib\site-packages\TurboGears-1.0b2-py2.4.egg\turbogears\util
.py", line 119, in get_model
package = __import__(package_name, {}, {}, ["model"])
File "C:\esunspot\identity-test\identity_test\model.py", line 83, in
?
assign_mapper(session.context, Visit, visits_table)
NameError: name 'assign_mapper' is not defined
When I add the following line to model.py, the database creation works
without any error:
from sqlalchemy.ext.assignmapper import assign_mapper
Do I not understand something or was this just left out in 1.0b2?
Thanks for the help and great work!
Eric
Apparently not. This just tripped me up using a project newly created
with 1.0b2.
Yes, this is still a problem in 1.0b2. It should be fixed in the trunk,
and should not happen in the next release.
-Adam