def index(self, req, body=None): """Return all versions.""" builder = views_versions.get_view_builder(req) return builder.build_versions(VERSIONS)
def multi(self, req, body=None): """Return multiple choices.""" builder = views_versions.get_view_builder(req) return builder.build_choices(VERSIONS, req)
def show(self, req): builder = views_versions.get_view_builder(req) return builder.build_version(VERSIONS['v2.0'])
def show(self, req, id='v2.1'): builder = views_versions.get_view_builder(req) if id not in versions.VERSIONS: raise webob.exc.HTTPNotFound() return builder.build_version(versions.VERSIONS[id])