示例#1
0
    def show(self, req, id='v2.1'):
        builder = views_versions.get_view_builder(req)
        if req.is_legacy_v2():
            id = 'v2.0'
        if id not in versions.VERSIONS:
            raise webob.exc.HTTPNotFound()

        return builder.build_version(versions.VERSIONS[id])
    def show(self, req, id='v2.1'):
        builder = views_versions.get_view_builder(req)
        if req.is_legacy_v2():
            id = 'v2.0'
        if id not in versions.VERSIONS:
            raise webob.exc.HTTPNotFound()

        return builder.build_version(versions.VERSIONS[id])
示例#3
0
 def show(self, req):
     builder = views_versions.get_view_builder(req)
     return builder.build_version(VERSIONS['v2.0'])
示例#4
0
 def multi(self, req, body=None):
     """Return multiple choices."""
     builder = views_versions.get_view_builder(req)
     return builder.build_choices(VERSIONS, req)
示例#5
0
 def index(self, req, body=None):
     """Return all versions."""
     builder = views_versions.get_view_builder(req)
     return builder.build_versions(VERSIONS)
示例#6
0
 def index(self, req, body=None):
     builder = views_versions.get_view_builder(req)
     ver = 'v2.0' if req.is_legacy_v2() else 'v2.1'
     return builder.build_version(VERSIONS[ver])