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): builder = views_versions.get_view_builder(req) return builder.build_version(VERSIONS['v2.0'])
def multi(self, req, body=None): """Return multiple choices.""" builder = views_versions.get_view_builder(req) return builder.build_choices(VERSIONS, req)
def index(self, req, body=None): """Return all versions.""" builder = views_versions.get_view_builder(req) return builder.build_versions(VERSIONS)
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])