|
@@ -0,0 +1,47 @@
|
|
1
|
+# -*- coding: utf-8 -*-
|
|
2
|
+"""Main Controller"""
|
|
3
|
+
|
|
4
|
+from tg import expose, flash, require, url, lurl, request, redirect, tmpl_context
|
|
5
|
+from tg.i18n import ugettext as _, lazy_ugettext as l_
|
|
6
|
+from tg import predicates
|
|
7
|
+from pboard import model
|
|
8
|
+from pboard.controllers.secure import SecureController
|
|
9
|
+from pboard.model import DBSession, metadata
|
|
10
|
+from tgext.admin.tgadminconfig import TGAdminConfig
|
|
11
|
+from tgext.admin.controller import AdminController
|
|
12
|
+
|
|
13
|
+from pboard.lib.base import BaseController
|
|
14
|
+from pboard.controllers.error import ErrorController
|
|
15
|
+
|
|
16
|
+import pboard.model as pbm
|
|
17
|
+import pboard.controllers as pbc
|
|
18
|
+from pboard.lib import dbapi as pld
|
|
19
|
+from pboard.controllers import api as pbca
|
|
20
|
+
|
|
21
|
+import pboard.model.data as pbmd
|
|
22
|
+
|
|
23
|
+__all__ = ['DebugController']
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+class DebugController(BaseController):
|
|
27
|
+
|
|
28
|
+ allow_only = predicates.in_group('admin',
|
|
29
|
+ msg=l_('You\'re not allowed to access this page'))
|
|
30
|
+
|
|
31
|
+ @expose('pboard.templates.debug.iconset')
|
|
32
|
+ def iconset(self, **kw):
|
|
33
|
+ """This method showcases how you can use the same controller for a data page and a display page"""
|
|
34
|
+ return dict()
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+ @expose('pboard.templates.debug.environ')
|
|
38
|
+ def environ(self, **kw):
|
|
39
|
+ """This method showcases TG's access to the wsgi environment."""
|
|
40
|
+ return dict(environment=request.environ)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+ @expose('pboard.templates.debug.identity')
|
|
44
|
+ def identity(self, **kw):
|
|
45
|
+ """This method showcases TG's access to the wsgi environment."""
|
|
46
|
+ return dict(identity=request.identity)
|
|
47
|
+
|