debug.py 1.3KB

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