[Grok-dev] Re: grok.layer branch
Kevin Smith
kevin at mcweekly.com
Tue Apr 17 12:45:55 EDT 2007
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
* rename grok.defineskin to grok.register_skin
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)
...
Kevin Smith
irc: ksmith99
More information about the Grok-dev
mailing list