On Jan 17, 2007, at 6:19 AM, Max Ischenko wrote:

It works, at least if I verify with "paster shell".

But I tried to write a simple test to assert this behavior and got a
strange error:

 File
"/home/max/projects/dou-trunk/site/doupy/doupy/tests/functional/ test_db_conn.py",
line 2, in ?
   from doupy.lib.database import *
 File "/home/max/projects/dou-trunk/site/doupy/doupy/lib/database.py",
line 15, in ?
   dburi = CONFIG['app_conf']['sqlalchemy.dburi']
 File
"/usr/lib/python2.4/site-packages/PasteDeploy-1.0-py2.4.egg/paste/ deploy/config.py",
line 119, in __getitem__
   raise TypeError(
TypeError: No configuration has been registered for this process or
thread

Your CONFIG object is automatically setup for you in paster shell, it won't be when running it from your own script.



Another issue. If I use DynamicMetadata, as recommended in QuickWiki
tutorial, how am I supposed to connect it to correct session_context?

Do I need to create engine explicitly (via create_engine) and then call
meta.connect(engine)? If so, when this should happen?



Yes, you do need to connect the engine explicitly if you want to use metadata functions, such as create_all.

Take a look at the QuickWiki's websetup.py. It has examples of both setting up the CONFIG object and using metadata.create_all.

--
Philip Jenvey



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to