Re: [sqlalchemy] ...and MVC

2015-05-26 Thread Burak Arslan
hello, On 05/25/15 16:51, c.bu...@posteo.jp wrote: I know there is no absolute solution for my question. I just want to hear your suggestions and how you do this in your practice. In which layer of the MVC-pattern are all the SQLAlchemy objects located? There should be a Session for each

Re: [sqlalchemy] ...and MVC

2015-05-26 Thread David Allouche
On 26 May 2015, at 09:16, Burak Arslan burak.ars...@arskom.com.tr wrote: same here but before passing the model instance from controller to view, all instances are detached from session (via expunge()). this 1) prevents a lot of unexpected db queries. 2) lets you recycle db connections as

Re: [sqlalchemy] ...and MVC

2015-05-26 Thread Mike Bayer
On 5/26/15 7:26 AM, David Allouche wrote: On 26 May 2015, at 09:16, Burak Arslan burak.ars...@arskom.com.tr wrote: same here but before passing the model instance from controller to view, all instances are detached from session (via expunge()). this 1) prevents a lot of unexpected db queries.

[sqlalchemy] ...and MVC

2015-05-25 Thread c.buhtz
I know there is no absolute solution for my question. I just want to hear your suggestions and how you do this in your practice. In which layer of the MVC-pattern are all the SQLAlchemy objects located? There should be a Session for each action. But who does this action? The controller? In my