[Grok-dev] Re: grok.layer branch
Philipp von Weitershausen
philipp at weitershausen.de
Tue Apr 17 12:48:53 EDT 2007
On 17 Apr 2007, at 18:45 , Kevin Smith wrote:
> Unless someone has an alternate proposal, based on comments by
> Philipp and Leonardo, I'm going to reimplement the grok.layer
> branch as such...
>
> * grok.Layer implements IBrowserRequest
> * rename grok.layer to grok.for_layer
-1. I certainly prefer grok.layer over grok.for_layer, but I would
grok.request prefer even more (following the grok.context() example).
> * rename grok.defineskin to grok.register_skin
+1
> class Debug(grok.Layer):
> pass # grok.Layer inherits from IBrowserRequest
>
> class Public(grok.Layer):
> pass
>
> class Dev(Public, Debug):
> pass
>
> grok.register_skin('Dev', Dev)
> grok.register_skin('Public', Public)
>
> grok.for_layer(Public) # define default layer at module level
>
> class MyPublicView(grok.View):
> """ Uses layer defined at module level by default """
> ...
>
> class MyDevView(grok.View):
> """ Overrides module level layer registration """
> grok.for_layer(Dev)
> ...
Looks good otherwise!
More information about the Grok-dev
mailing list