def view_auth_defaults(fn, *args, **kwargs): kwargs.setdefault('accept', 'text/html') kwargs.setdefault('renderer', 'h:templates/auth.html.jinja2') return view_defaults(*args, **kwargs)(fn)
def web(name='webapi'): return view_defaults(route_name=name)
def api_defaults(context=None, login_required=True, *args, **kwargs): return view_defaults(renderer='json', context=context, *args, **kwargs)
def view_auth_defaults(fn, *args, **kwargs): kwargs.setdefault('accept', 'text/html') kwargs.setdefault('decorator', ensure_csrf_token) kwargs.setdefault('layout', 'auth') kwargs.setdefault('renderer', 'h:templates/auth.html') return view_defaults(*args, **kwargs)(fn)
def wrapped(controller): cls.registry[name] = controller controller = view_defaults(**kwargs)(controller) return controller
def view_auth_defaults(fn, *args, **kwargs): kwargs.setdefault("accept", "text/html") kwargs.setdefault("renderer", "h:templates/auth.html.jinja2") return view_defaults(*args, **kwargs)(fn)