summaryrefslogtreecommitdiff
path: root/repoze/bfg/chameleon_zpt.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-09-14 04:33:38 +0000
committerChris McDonough <chrism@agendaless.com>2009-09-14 04:33:38 +0000
commit04e182bbc0c077afcd921f0df4231020549dc217 (patch)
treea994d2508aaac376b76e04dd4335129b6391dca1 /repoze/bfg/chameleon_zpt.py
parentf587c76deac60c0a328975dcc4641d0f85984e63 (diff)
downloadpyramid-04e182bbc0c077afcd921f0df4231020549dc217.tar.gz
pyramid-04e182bbc0c077afcd921f0df4231020549dc217.tar.bz2
pyramid-04e182bbc0c077afcd921f0df4231020549dc217.zip
- A ZCML ``view`` directive (and the associated ``bfg_view``
decorator) can now accept an "attr" value. If an "attr" value is supplied, it is considered a method named of the view object to be called when the response is required. This is typically only good for views that are classes or instances (not so useful for functions, as functions typically have no methods other than ``__call__``). - A ZCML ``view`` directive (and the associated ``bfg_view`` decorator) can now accept a "template" value. If a "template" value is supplied, and the view callable returns a dictionary, the associated template is rendered with the dictionary as keyword arguments.
Diffstat (limited to 'repoze/bfg/chameleon_zpt.py')
-rw-r--r--repoze/bfg/chameleon_zpt.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/repoze/bfg/chameleon_zpt.py b/repoze/bfg/chameleon_zpt.py
index f4f899879..c66a69e66 100644
--- a/repoze/bfg/chameleon_zpt.py
+++ b/repoze/bfg/chameleon_zpt.py
@@ -8,9 +8,9 @@ from zope.interface import implements
from repoze.bfg.interfaces import IResponseFactory
from repoze.bfg.interfaces import ITemplateRenderer
from repoze.bfg.interfaces import ITemplateRendererFactory
-from repoze.bfg.interfaces import ISettings
from repoze.bfg.templating import renderer_from_cache
+from repoze.bfg.templating import _auto_reload
from chameleon.zpt.template import PageTemplateFile
class ZPTTemplateRenderer(object):
@@ -26,11 +26,6 @@ class ZPTTemplateRenderer(object):
def __call__(self, **kw):
return self.template(**kw)
-def _auto_reload():
- settings = queryUtility(ISettings)
- auto_reload = settings and settings.reload_templates
- return auto_reload
-
def get_renderer(path):
""" Return a callable ``ITemplateRenderer`` object representing a
``chameleon.zpt`` template at the package-relative path (may also