[Checkins] SVN: five.customerize/branches/baarn-sprint/src/five/customerize/ added an interface for `TTWViewTemplate` to be able to register the view using an interface instead of the class; otherwise the attribute `__identifier__` won't be available for those views, which breaks five.customerize itself as it uses it to display information about the views

Andreas Zeidler az at zitc.de
Mon Feb 19 12:42:14 EST 2007


Log message for revision 72685:
  added an interface for `TTWViewTemplate` to be able to register the view using an interface instead of the class;  otherwise the attribute `__identifier__` won't be available for those views, which breaks five.customerize itself as it uses it to display information about the views

Changed:
  U   five.customerize/branches/baarn-sprint/src/five/customerize/configure.zcml
  A   five.customerize/branches/baarn-sprint/src/five/customerize/interfaces.py
  U   five.customerize/branches/baarn-sprint/src/five/customerize/zpt.py

-=-
Modified: five.customerize/branches/baarn-sprint/src/five/customerize/configure.zcml
===================================================================
--- five.customerize/branches/baarn-sprint/src/five/customerize/configure.zcml	2007-02-19 17:19:47 UTC (rev 72684)
+++ five.customerize/branches/baarn-sprint/src/five/customerize/configure.zcml	2007-02-19 17:42:13 UTC (rev 72685)
@@ -41,7 +41,7 @@
   <subscriber handler=".zpt.unregisterViewWhenZPTIsDeleted"/>
 
   <browser:pages
-      for=".zpt.TTWViewTemplate"
+      for=".zpt.ITTWViewTemplate"
       class=".browser.RegistrationsView"
       permission="five.ManageSite">
     <browser:page

Added: five.customerize/branches/baarn-sprint/src/five/customerize/interfaces.py
===================================================================
--- five.customerize/branches/baarn-sprint/src/five/customerize/interfaces.py	2007-02-19 17:19:47 UTC (rev 72684)
+++ five.customerize/branches/baarn-sprint/src/five/customerize/interfaces.py	2007-02-19 17:42:13 UTC (rev 72685)
@@ -0,0 +1,9 @@
+from zope.interface import Interface
+
+
+class ITTWViewTemplate(Interface):
+    """ ttw customizable page template view """
+
+    def __call__(context, request):
+        """ render the template/view """
+

Modified: five.customerize/branches/baarn-sprint/src/five/customerize/zpt.py
===================================================================
--- five.customerize/branches/baarn-sprint/src/five/customerize/zpt.py	2007-02-19 17:19:47 UTC (rev 72684)
+++ five.customerize/branches/baarn-sprint/src/five/customerize/zpt.py	2007-02-19 17:42:13 UTC (rev 72685)
@@ -4,9 +4,14 @@
 
 from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
 from zope.app.container.interfaces import IObjectRemovedEvent
+from zope.interface import implements
 
+from five.customerize.interfaces import ITTWViewTemplate
+
+
 class TTWViewTemplate(ZopePageTemplate):
     """A template class used to generate Zope 3 views TTW"""
+    implements(ITTWViewTemplate)
 
     manage_options = (
         ZopePageTemplate.manage_options[0],



More information about the Checkins mailing list