On Jan 18, 2008, at 11:58 AM, Brian Sutherland wrote:
What about zope.pagetemplate.interfaces.IPageTemplate?


Good, because there are no new interfaces that way.

Personally I like the way z3c.form.form.BaseForm approaches this:

   def render(self):
       '''See interfaces.IForm'''
       # render content template
       if self.template is None:
template = zope.component.getMultiAdapter((self, self.request),
               IPageTemplate)
           return template(self)
       return self.template()

That almost supports the use case. Do the adaptation first, then use self.template if there's no adapter, and you're golden.

If a view needs more than one template, it can use names to distinguish the cases.


  -Fred

--
Fred L. Drake, Jr.    <fdrake at gmail.com>

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )

Reply via email to