On Tue, Mar 3, 2009 at 21:12, grat <[email protected]> wrote: > i have this Entity: > > class Titul(Entity): > using_options(tablename='tituly') > name = Field(Unicode(200)) > > .... > > and if i use > > t1=Titul.query().......... is OK, but > t2=session.execute("select * from tituly")... i get this ERROR: > > File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.5.2-py2.6.egg/ > sqlalchemy/orm/session.py", line 893, in get_bind > ', '.join(context))) > sqlalchemy.exc.UnboundExecutionError: Could not locate a bind > configured on SQL expression or this Session > > Where is bug?
No bug. SA knows that the Titul table is bound to your database engine, but it doesn't try to guess which tables or engines are used within a "plain text" query. So if you want to use that "plain text" query, you have to bind the session to your engine. -- Gaëtan de Menten http://openhex.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SQLElixir" 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/sqlelixir?hl=en -~----------~----~----~----~------~----~------~--~---
