[Grok-dev] template association - suboptimal magic?

Lennart Regebro regebro at gmail.com
Fri Sep 5 03:23:37 EDT 2008


On Fri, Sep 5, 2008 at 00:30, Jan-Wijbrand Kolman <janwijbrand at gmail.com> wrote:
> * The grok.template() directive sets a template name explicitly:
>
> class ViewA(grok.View):
>  grok.template('sometemplatename')

This seems overly complex. If we don't have magic association, then

class ViewA(grok.View):
    template = PageTemplateFile('file/path')

seems perfectly useable and 100% non-magic to me. That's what I
expected from Grok from the beginning. Maybe I've done too much old
Zope2 development. :)  Having a grok.template('file/path') also seems
better than having the template directory look for the template in
magic place.  Aaaand.... does this actually solve your original
problem of subclassing components?

-- 
Lennart Regebro: Zope and Plone consulting.
http://www.colliberty.com/
+33 661 58 14 64


More information about the Grok-dev mailing list