Пример #1
0
class PotCaveContentProvider(CaveContentProvider):
    grok.view(PotView)
Пример #2
0
"""

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):
Пример #3
0
class CavewomenContentProviderWithTemplate(grok.ContentProvider):
    grok.name('manage.cavewomenwithtemplate')
    grok.template('mirandaprovider')
    grok.view(Necklace)
Пример #4
0
class CavewomenContentProvider(grok.ContentProvider):
    grok.name('manage.cavewomen')
    grok.view(Index)

    def render(self):
        return u'%r %r %r' % (self.context, self.view, self)
Пример #5
0
  >>> 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"
Пример #6
0
class CavemenContentProvider(grok.ContentProvider):
    grok.name('manage.cavemen')
    grok.view(ICavemenView)

    def render(self):
        return u'Hi'