app.view.base module

class app.view.base.ProfileJsonView(**kwargs)[源代码]

基类:ProfileView, SecureJsonView

json_response(extra_data=None, **kwargs)[源代码]
logger_name: str = 'ProfileAPIerror'
class app.view.base.ProfileTemplateView(**kwargs)[源代码]

基类:ProfileView, SecureTemplateView

logger_name: str = 'ProfileError'
page_name: str
render(**kwargs)[源代码]
class app.view.base.ProfileView(**kwargs)[源代码]

基类:SecureView

PrepareType

Callable[[], Callable[[], HttpResponse] | None] | None 的别名

check_access: bool = True
check_perm() None[源代码]

检查用户是否登录及权限

dispatch_prepare(method: str)[源代码]

每个方法执行前的准备工作,返回重定向的方法

准备方法的约定以当前类PrepareType为准,PrepareType包含None的可只实现处理方法 SecureView要求必须实现准备方法,子类如果准备方法命名错误未调用则无法提供错误信息 子类建议使用match语句,不存在时可调用`default_prepare`

get_logger()[源代码]

获取日志记录器

logger_name: str
need_prepare: bool = True
request: HttpRequest