On Jun 13, 2007, at 12:07 PM, voltron wrote:

>
> aha, ok, thanks, but I saw it in the docs, ist it deprecated?  Then I
> ´m in a spot

DynamicMetaData is not deprecated.   but when you connect to it, its  
a thread-local connection.  other threads that access it wont have  
any engine. you just want to use a regular MetaData, which these days  
has a connect() method.  but you might not even need to do that with  
a pylons configuration.

>
> If I go the route of creating meta first I would have to create it in
> every table file, in users.py, addresses.py e.tc. I tried using a file
> called _initmodels.py and created the metadata only once and made alle
> the separate table files import from it, but that ultimately failed
> because when I imported it in websetup.py in pylons so I can use it to
> setup my databses and app, it did not find the metadata properly, it
> assumed it was another metadata, and naturally, no dtabases were
> created

that sounds like you need to get control of your application  
modules.  you should declare your metadata in some common place, like  
for pylons in base.py or app_globals.py, where everyone else can get  
to it.

but additionally, Pylons connects the database to the session, so  
typically in a pylons app theres not even any need to connect the  
engine to the metadata.  to issue a create_all() just do  
metadata.create_all(connectable=sessioncontext.current.connect()).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to