Пример #1
0
class RootController(object):

    v2 = v2.V2Controller()

    @pecan.expose(generic=True, template='index.html')
    def index(self):
        # FIXME: Return version information
        return dict()
Пример #2
0
class RootController(object):

    v2 = v2.V2Controller()

    @pecan.expose('json')
    def index(self):
        base_url = pecan.request.host_url
        available = [{'tag': 'v2', 'date': '2013-02-13T00:00:00Z', }]
        collected = [version_descriptor(base_url, v['tag'], v['date'])
                     for v in available]
        versions = {'versions': {'values': collected}}
        return versions