[Checkins]
SVN: Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/PageTemplate.py
More API BBB: Add a stupid html() method that supports an
is_html property
Philipp von Weitershausen
philikon at philikon.de
Sun May 21 15:29:38 EDT 2006
Log message for revision 68218:
More API BBB: Add a stupid html() method that supports an is_html property
hook. Stupid, stupid, stupid.
Changed:
U Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/PageTemplate.py
-=-
Modified: Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/PageTemplate.py
===================================================================
--- Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/PageTemplate.py 2006-05-21 15:45:14 UTC (rev 68217)
+++ Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/PageTemplate.py 2006-05-21 19:29:37 UTC (rev 68218)
@@ -102,3 +102,12 @@
if not kwargs.has_key('args'):
kwargs['args'] = args
return self.pt_render(extra_context={'options': kwargs})
+
+ # convenience method for the ZMI which allows to explicitly
+ # specify the HTMLness of a template. The old Zope 2
+ # implementation had this as well, but arguably on the wrong class
+ # (this should be a ZopePageTemplate thing if at all)
+ def html(self):
+ if not hasattr(getattr(self, 'aq_base', self), 'is_html'):
+ return self.content_type == 'text/html'
+ return self.is_html
More information about the Checkins
mailing list