#1146: sqlalchemy + sqlite autoload doesn't work in 1.0b1
------------------------+---------------------------------------------------
 Reporter:  kkinder     |       Owner:  anonymous                       
     Type:  defect      |      Status:  new                             
 Priority:  normal      |   Milestone:                                  
Component:  SQLAlchemy  |     Version:  1.0b1                           
 Severity:  major       |    Keywords:  sqlalchemy reflecttable autoload
------------------------+---------------------------------------------------
 sqlalchemy's autoload table reflection doesn't work (at least with sqlite)
 in 1.01b. This is because metadata.engine is None at the time model is
 imported, which prevents sqlalchemy from inspecting the database schema.

 To reproduce this bug, quickstart a project with sqlalchemy. Create a
 blank sqlite database with sqladmin sql create. Then, manually create a
 table in the database using the sqlite3 command.

 Add that table to your model.py by doing, table = Table('table name',
 metadata', autoload=True)

 You will get one of these when you try to run tg-admin shell:

 {{{
 Traceback (most recent call last):
   File "model.py", line 8, in ?
     x = Table('Albums', metadata, autoload=True)
   File "build/bdist.linux-i686/egg/sqlalchemy/schema.py", line 138, in
 __call__
 AttributeError: 'NoneType' object has no attribute 'reflecttable'
 }}}

 This is because, at the time of model's import, metadata.engine is None.

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/1146>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" 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-tickets
-~----------~----~----~----~------~----~------~--~---

Reply via email to