turbogears 2 and pylons db session differences

1 view
Skip to first unread message

webguy7890

unread,
Nov 20, 2009, 2:50:24 PM11/20/09
to TurboGears
Hi all,

I am currently having a problem with loading farmdev fixtures in my
functional tests. Kumar mentioned that he ran into the problem with
Pylons, and recommend that I use meta.Session.remove() to clear the
session between tests.

In Pylons, they recommend that you do the following in the lib/
base.py:

try:
return WSGIController.__call__(self, environ,
start_response)
finally:
meta.Session.remove()


But in Turbogears, I noticed that DBSession is not initialized within
the init_model method (TG also doesn't use the metadata object). Why
is that? I am curious on what the benefits are for each approach.
Also, how do I clear the session? Many thanks!

Cheers,
Steve
Reply all
Reply to author
Forward
0 new messages