[Grok-dev] template association - suboptimal magic?

Jan-Wijbrand Kolman janwijbrand at gmail.com
Fri Sep 5 04:35:00 EDT 2008


Lennart Regebro wrote:
> On Fri, Sep 5, 2008 at 00:30, Jan-Wijbrand Kolman
> 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?

Yes it does, just like your solution would: the grok.template()
directive would store the exact path to a the template file and this is
information would be available on the subclasses - that's how directives
work.

regards,
jw



More information about the Grok-dev mailing list