[Grok-dev] Re: defining permissions in a module

Jan-Wijbrand Kolman janwijbrand at gmail.com
Tue Jul 24 10:52:36 EDT 2007

On 7/24/07, Philipp von Weitershausen <philipp at weitershausen.de> wrote:
> > This *does* work, but still feel ugly as in fact the permissions will
> > get registered twice. In practice this cannot really hurt, but, well,
> > feels ugly :-)
> How about allow modules to say that they depend on other modules being
> grokked first, e.g.::
>    from myapp import permissions
>    grok.depends(permissions)
>    class MyView(grok.View):
>        grok.require(permissions.DISPLAY_VIEW)

It's at least a lot cleaner than relying on double registrations of
the permissions not to have nasty side-effects...

Well, if the grok.depends could actually make sure the permissions
module is not grokkked again, but I guess that *is* your intention

Martijn, what's your view on this in relation to martian?

kind regards,

Jan-Wijbrand Kolman

More information about the Grok-dev mailing list