[Grok-dev] template association - suboptimal magic?
regebro at gmail.com
Fri Sep 5 03:13:20 EDT 2008
On Fri, Sep 5, 2008 at 00:30, Jan-Wijbrand Kolman <janwijbrand at gmail.com> wrote:
> * Since template registries are tied to modules a template defined on a
> component in one module cannot be used by sublcasses of this component
> defined in an other module. This results in a unexpected and difficult
> to solve situation for the application developer (the original issue I
> tried to solve).
Yeah, this is unexpected. But I thought it was because the template
was adapted to the class, not the interface, and hence the view lookup
during traversal would fail? Maybe I misunderstood that.
> * Whenever you want to (re)use a template file for components in
> multiple modules, you have to use grok.templatedir() in each of these
> modules. This in itself is not a problem, however it is likely that this
> templates directory then contains template files that cannot not be
> associated with all components of all modules that make use of this one
> "shared" directory.
Yeah, that's not a solution.
> * If at some point in the development of an application a new component
> is introduced with a render() method *and* having a classname that is
> resolvable to a template that was created earlier in the development
> process, "suddenly" an error is raised. This is annoying to say the least.
I thinks thats OK, and expected. But the argument that the template
magic has become to complex is hard to deny, and maybe this should be
made more explicit. I do have to say that I never liked the
x_templates magic, but changing this does break every single Grok
application in existence. ;)
Lennart Regebro: Zope and Plone consulting.
+33 661 58 14 64
More information about the Grok-dev