Am 18.05.2011 18:54 schrieb Adrian:
model, and in each controller I do: from webapp.model import
DBSession, session = DBSession(), session.query(..)... etc.

Actually you can just import DBSession and then use DBSession directly, i.e. DBSession.query(User) etc. since it's a scoped session which provides everything at the class level already.

I'm not sure if instantiating DBSession() can be harmful or whether this means that you also have to care for closing or removing the session instance afterwards. Can you try if using the class directly works better for you?

-- Christoph

--
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en.

Reply via email to