I'm still seeing cases where the engine isn't bound within the 
VisitManager thread or when running "tg-admin sql create". Both of these 
are reproducible with the project created by "tg-admin quickstart -i -s 
-p tgtest tgtest" as of turbogears-1.0 r1614 -- the former after making 
a request and waiting a minute for the visit management thread to try to 
update the database, and the latter running "tg-admin sql create".

The attached patch resolves both issues.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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
-~----------~----~----~----~------~----~------~--~---
Index: turbogears/visit/savisit.py
===================================================================
--- turbogears/visit/savisit.py	(revision 1614)
+++ turbogears/visit/savisit.py	(working copy)
@@ -5,6 +5,7 @@
 
 from turbogears.visit.api import BaseVisitManager, Visit
 from turbogears import config
+from turbogears.database import bind_meta_data
 from turbogears.util import load_class
 
 import logging
@@ -19,6 +20,7 @@
         visit_class_path = config.get("visit.saprovider.model",
                                "turbogears.visit.savisit.TG_Visit")
         visit_class = load_class(visit_class_path)
+        bind_meta_data()
         
     def create_model(self):
         "Not implemented here. You need to create the tables another way."
Index: turbogears/command/base.py
===================================================================
--- turbogears/command/base.py	(revision 1614)
+++ turbogears/command/base.py	(working copy)
@@ -62,6 +62,7 @@
 def sacreate(command, args):
     print "Creating tables at %s" % (config.get("sqlalchemy.dburi"))
     from turbogears.database import bind_meta_data, metadata
+    bind_meta_data()
     get_model()
     metadata.create_all()
     

Reply via email to