Mercurial > kallithea
comparison pylons_app/controllers/admin/admin.py @ 350:664a5b8c551a
Added application settings, are now customizable from database
fixed all instances of sqlachemy to be removed() after execution.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 14 Jul 2010 18:31:06 +0200 |
parents | 8026872a10ee |
children |
comparison
equal
deleted
inserted
replaced
349:031152a540c5 | 350:664a5b8c551a |
---|---|
38 def __before__(self): | 38 def __before__(self): |
39 super(AdminController, self).__before__() | 39 super(AdminController, self).__before__() |
40 | 40 |
41 @HasPermissionAllDecorator('hg.admin') | 41 @HasPermissionAllDecorator('hg.admin') |
42 def index(self): | 42 def index(self): |
43 sa = meta.Session | 43 |
44 | 44 users_log = self.sa.query(UserLog).order_by(UserLog.action_date.desc()) |
45 users_log = sa.query(UserLog).order_by(UserLog.action_date.desc()) | |
46 p = int(request.params.get('page', 1)) | 45 p = int(request.params.get('page', 1)) |
47 c.users_log = Page(users_log, page=p, items_per_page=10) | 46 c.users_log = Page(users_log, page=p, items_per_page=10) |
48 c.log_data = render('admin/admin_log.html') | 47 c.log_data = render('admin/admin_log.html') |
49 if request.params.get('partial'): | 48 if request.params.get('partial'): |
50 return c.log_data | 49 return c.log_data |