Re: [sqlalchemy] should we wrap sqlalchemy query with a session scope ?

2015-02-09 Thread Michael Bayer
Hao Yan wrote: > Want to ask you guys opinions about this :In the spirit of separating > lifecycle of sqlalchemy session from actual operations on db, sqlalchemy > suggests the following pattern > (http://docs.sqlalchemy.org/en/rel_0_9/orm/session_basics.html ): > > > def go(self, sess

[sqlalchemy] should we wrap sqlalchemy query with a session scope ?

2015-02-09 Thread Hao Yan
Want to ask you guys opinions about this :In the spirit of separating lifecycle of sqlalchemy session from actual operations on db, sqlalchemy suggests the following pattern ( http://docs.sqlalchemy.org/en/rel_0_9/orm/session_basics.html ): ### this is a **better** (but not the only) way to do