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),
           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 L. Drake, Jr.    <fdrake at gmail.com>

Zope-Dev maillist  -  Zope-Dev@zope.org
**  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