Consider using sqlahelper for this. It was made for exactly this purpose. You import it to both model.__init__.py and project.__init__.py. It can keep track of your base, engine, and session.
https://bitbucket.org/sluggo/sqlahelper/overview In case you are also using Mako for templating and URL dispatch for routing, you might consider using the Akhet scaffold (application template for paster) to set up your project if it's still early in the process. Or just make a quick virtualenv and start a temporary/test project in there using Akhet and look at how it sets up the project files by default. On Jun 25, 5:19 am, Grigoriy Tretyakov <[email protected]> wrote: > Hello. > > I'd like to use declarative_base from sqlalchemy.ext in my project. But for > initialize Base, I need engine. How I can get initialized engine in > model.__init__.py? > > May be I could use engine=None? > > Thanks. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en.
