[Grok-dev] static versus Zope 3's directory resources
darryl at darrylcousins.net.nz
Mon Nov 19 15:21:05 EST 2007
This is pretty much how mars.resource works
Note that I haven't worked on the mars packages for some time (lack of
time and not lack of enthusiasm).
The mars packages grew from a desire to make use of z3c packages.
On Mon, 2007-11-19 at 13:40 +0100, Jan-Wijbrand Kolman wrote:
> Grok has built-in support for a resourcedirectory-like feature with the
> "static" subdirectories.
> There's a couple of problems with it though:
> * The resources in the static directory are "published" in the
> IBrowserDefault layer, and cannot be published in another layer.
> * Templates in one package might want to use macros defined in
> another package. If the macro refers to resources in the static
> directory, the lookup fails.
> Both cases are by no means disasters if you ask me, and I think we
> should continue to support the static directory for the "simple" situations.
> For more complex setups however, I think it might be worthwhile to have
> Grok support for Zope 3's (directory)resources. This would then play
> nice with other resource related libraries "out there" like
> I can imagine something like:
> import grok
> class FooResources(grok.DirectoryResources):
> grok.name('foo') # optional, has some sensible default
> grok.layer('my_apps_layer') # optional, like with grok.View
> grok.directory('foo_resources') # optional, has some sensible
> # default
> What do others think?
> kind reagrds,
> Grok-dev mailing list
> Grok-dev at zope.org
More information about the Grok-dev