On Nov 24, 2010, at 7:10 PM, Daniel Holth wrote: > I recommend the status quo. My reusable pyramid application will not need to > import pyramid_sqla. It will: > • have its own declarative base > • require the user to call ponzi_auth.configure_database(engine) > • not use database reflection, and so will not need a configured engine > before import (the Session is not used for database reflection) > • not use ScopedSession.query_property() > • not use the Session at all in the models or use object_session(self) > • access the session as a request parameter in views, attached in an > INewRequest callback as something like request.db > On the other hand, when I configure my engine from the .ini it's just > > configure_engine(settings['sqlalchemy.url']) > > So I think the way it works now is fine.
Yea, that's just more to document, which maybe is fine. I'm probably not the best opinion on this as my setups are all generally unique. I'd prefer to just document it then have a package, but I do recall there being some benefit to having a place for people to be able to get to the session, or to ensure the engine is configured and bound first. The main advantage to having the package is that since one doesn't need to import anything from their own models during config, reflective tables are easier. As you mention, you don't use table reflection, so maybe this isn't an issue for you. Cheers, Ben -- You received this message because you are subscribed to the Google Groups "pylons-devel" group. To post to this group, send email to pylons-de...@googlegroups.com. To unsubscribe from this group, send email to pylons-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/pylons-devel?hl=en.