class PotCaveContentProvider(CaveContentProvider): grok.view(PotView)
""" import grokcore.view as grok class Fred(grok.Context): pass class CaveView(grok.View): def render(self): return u"Cave" grok.view(CaveView) class BoneView(grok.View): pass class CaveContentProvider(grok.ContentProvider): grok.name('cave') def render(self): pass class PotView(grok.View): def render(self):
class CavewomenContentProviderWithTemplate(grok.ContentProvider): grok.name('manage.cavewomenwithtemplate') grok.template('mirandaprovider') grok.view(Necklace)
class CavewomenContentProvider(grok.ContentProvider): grok.name('manage.cavewomen') grok.view(Index) def render(self): return u'%r %r %r' % (self.context, self.view, self)
>>> browser.contents 'Pot' """ import grokcore.view as grok class Fred(grok.Context): pass class CaveView(grok.View): def render(self): return u"Cave" grok.view(CaveView) class BoneView(grok.View): pass class CaveContentProvider(grok.ContentProvider): grok.name('cave') def render(self): pass class PotView(grok.View): def render(self): return u"Pot"
class CavemenContentProvider(grok.ContentProvider): grok.name('manage.cavemen') grok.view(ICavemenView) def render(self): return u'Hi'