Searching for one tag works. Two tags acts like or and returns multiple copies.
[zzz-floof.git] / floof / lib / base.py
index d2756ba..cb7c746 100644 (file)
@@ -2,19 +2,21 @@
 
 Provides the BaseController class for subclassing.
 """
-from pylons import session, tmpl_context as c
 from pylons.controllers import WSGIController
 from pylons.templating import render_mako as render
-
+from pylons import config
 from floof import model
-from floof.model import meta
+
+from pylons import session, tmpl_context as c
+from floof.model.users import User
 
 class BaseController(WSGIController):
 
+    # NOTE: This could have been implemented as a middleware =]
     def __before__(self, action, **params):
         # Fetch current user object
         try:
-            c.user = meta.Session.query(model.User).get(session['user_id'])
+            c.user = User.query.get(session['user_id'])
         except:
             pass
 
@@ -23,7 +25,10 @@ class BaseController(WSGIController):
         # WSGIController.__call__ dispatches to the Controller method
         # the request is routed to. This routing information is
         # available in environ['pylons.routes_dict']
+
+        # Insert any code to be run per request here.
+
         try:
             return WSGIController.__call__(self, environ, start_response)
         finally:
-            meta.Session.remove()
+            model.Session.remove()