[Grok-dev] summary templating/skinning discussion

Kevin Smith kevin at mcweekly.com
Tue May 22 11:16:28 EDT 2007

> Kevin, what do you think needs to be done for a)? I'm quite interested 
> in starting that integration work, as I have the impression we're 
> quite far along in this.
 From the doctests of the ksmith_mcweekly-layers branch, here is the 
implementation as is. All tests pass, if there is consensus on the 
naming, it's ready for merge.


class MySkinLayer(grok.ILayer): # inherits from IDefaultBrowserLayer

class MySkin(grok.Skin):
    grok.name('myskin') # this is actually the default

class Mammoth(grok.Model):

class CaveDrawings(grok.View):
    pass # uses module-level grok.layer(IBasicSkin)

cavedrawings = grok.PageTemplate("""\
<h1>Hello, world!</h1>

class MoreDrawings(grok.View):
    grok.layer(rotterdam) # overrides grok.layer(IBasicSkin)

    def render(self):
        return "Pretty"

class EvenMoreDrawings(grok.View):

    def render(self):
        return "Awesome"

More information about the Grok-dev mailing list