projects
/
zzz-floof.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Index page lists titles of art in the "art" table.
[zzz-floof.git]
/
floof
/
lib
/
base.py
diff --git
a/floof/lib/base.py
b/floof/lib/base.py
index
fd6ee47
..
d2756ba
100644
(file)
--- a/
floof/lib/base.py
+++ b/
floof/lib/base.py
@@
-2,13
+2,22
@@
Provides the BaseController class for subclassing.
"""
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.controllers import WSGIController
from pylons.templating import render_mako as render
+from floof import model
from floof.model import meta
class BaseController(WSGIController):
from floof.model import meta
class BaseController(WSGIController):
+ def __before__(self, action, **params):
+ # Fetch current user object
+ try:
+ c.user = meta.Session.query(model.User).get(session['user_id'])
+ except:
+ pass
+
def __call__(self, environ, start_response):
"""Invoke the Controller"""
# WSGIController.__call__ dispatches to the Controller method
def __call__(self, environ, start_response):
"""Invoke the Controller"""
# WSGIController.__call__ dispatches to the Controller method