On Fri, Jan 18, 2008 at 04:35:58PM +0100, Malthe Borch wrote:
> Getting back to the monkey, perhaps it would make sense to formalize the
> way a template object gets its source file. The template class could
> adapt to an ``IFileSource`` implementation that would provide a filename.
What about zope.pagetemplate.interfaces.IPageTemplate?
Personally I like the way z3c.form.form.BaseForm approaches this:
# render content template
if self.template is None:
template = zope.component.getMultiAdapter((self, self.request),
That way the template is just a multi adapter. I've made a zcml
directive that registers a template as just such a multi-adapter:
"bindings" explicitly defines what names each of the adapted objects is
available as in the template. Because sometimes I don't only have a
context and request.
The only problem is that IPageTemplate is a bit heavy as an interface,
it would perhaps be nicer to have a parent interface that only defines a
Zope-Dev maillist - Zope-Dev@zope.org
** No cross posts or HTML encoding! **
(Related lists -