On Jun 29, 2008, at 12:46 PM, Andreas Jung wrote:

> This approach is ugly (because of putting the mapper within the local
> scope into the global scope (in order to make them importable) and  
> because
> of this code within main.py:
>
> import model
> model.setup(dsn)
> from model import MyMapper, Session
>
> This there any better pattern for implementing this?


you don't need to pass DSN as a parameter.  The "engine" argument to  
declarative_base() is optional, and the docs have been revised in  
recent months to reflect this.

--~--~---------~--~----~------------~-------~--~----~
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