[Grok-dev] generic directoryresource in grokcore.view

Jan-Wijbrand Kolman janwijbrand at gmail.com
Tue Oct 21 15:19:17 EDT 2008

Kevin Teague wrote:
> To answer my own question:
> Should DirectoryResources be used to share page templates between
> packages?
> No (at least in my use case). DirectoryResources are request
> dependent, and also publish those resources directly on the web.
> Neither of which my template sharing use case cares about, I just want
> "extension" packages to use a template defined in a parent package ...
> so a simple function in the main package:


> And then the extension packages can use this template with:
> import gum
> class CustomEditForm(grok.EditForm):
>     template = gum.edit_form_template()
> Solves my problem with a minimum amount of fuss :_)
> (and I'm still using a DirectoryResource to share js, css, images
> between packages)

Yes, indeed.

Note that i'm still working on getting the template-inheritance issue
fixed. This would at least partially solve your problem of subclassing a
 view component that has a template, from another package.


More information about the Grok-dev mailing list