Quickstart with SQLAlchemy and Identity in 1.0b2

3 views
Skip to first unread message

ericdc...@gmail.com

unread,
Dec 5, 2006, 1:10:18 PM12/5/06
to TurboGears
I am having trouble with quickstart, SQLAlchemy, and Identity in TG
1.0b2.

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

Spider

unread,
Dec 5, 2006, 3:13:07 PM12/5/06
to TurboGears
I trhink this was fixed in ticket #1163 only a few days ago. It looks
like it should be in 1.0b2, however.

Steve Bergman

unread,
Dec 16, 2006, 10:22:52 PM12/16/06
to TurboGears

Spider wrote:
> I think this was fixed in ticket #1163 only a few days ago. It looks

> like it should be in 1.0b2, however.

Apparently not. This just tripped me up using a project newly created
with 1.0b2.

Adam Jones

unread,
Dec 17, 2006, 12:18:38 AM12/17/06
to TurboGears

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

Reply all
Reply to author
Forward
0 new messages