[Zope-dev] Interface for renderable component

Roger Ineichen dev at projekt01.ch
Mon Sep 15 18:39:04 EDT 2008


Hi Malthe
 
> Betreff: [Zope-dev] Interface for renderable component
> 
> Currently a number of z3c.* packages rely on 
> ``zope.pagetemplate.interfaces.IPageTemplate`` even though 
> they don't care at all that it's a template they're getting. 
> All they need to know is that it's a callable and that it 
> returns HTML.
> 
> I think it'd be a good idea to introduce the following 
> interface that we can use instead:
> 
>    class IRenderer(Interface):
>        def __call__(**kwargs):
>            """Outputs HTML."""
> 
> This interface should be defined in a package with minimal 
> dependencies.

Why not define a IHTMLProvider or someting like that
located in the zope.contentprovider package.

I think the contentprovider package is a good
location for anything like that.

btw, the IPageTemplate is only used as an adapter
lookup for templates at least in z3c.template.
The reason why it uses IPageTemplate is that the
adapter which get returned is an IPageTemplate.

If you introduce another new interface the
IPageTemplate has to provide that interface.

Regards
Roger Ineichen

> \malthe
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev at 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 )
> 



More information about the Zope-Dev mailing list