--On 29. Juni 2008 16:57:16 -0400 Michael Bayer <[EMAIL PROTECTED]> wrote:



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.


However the engine is required in order to perform autoloading.

Andreas

Attachment: pgpEpALHo4YAD.pgp
Description: PGP signature

Reply via email to