本文整理汇总了Python中django.views.generic.FormView.get方法的典型用法代码示例。如果您正苦于以下问题:Python FormView.get方法的具体用法?Python FormView.get怎么用?Python FormView.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类django.views.generic.FormView
的用法示例。
在下文中一共展示了FormView.get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from django.views.generic import FormView [as 别名]
# 或者: from django.views.generic.FormView import get [as 别名]
def get(self, request, *args, **kwargs):
""" a safe guard to make sure that user is already authenticated
:returns: if user is authenticated return form page OR return to form user login
using overiding @method_decorator(login_required)
"""
self.args=args
if self.request.user.is_authenticated():
return FormView.get(self, request, *args, **kwargs)
示例2: get_success_response
# 需要导入模块: from django.views.generic import FormView [as 别名]
# 或者: from django.views.generic.FormView import get [as 别名]
def get_success_response(self):
# No errors in get(), apply our form logic.
# NOTE that the checks are not make in the post() call, but this is not a problem.
# We can just store the payment method, and let the next view validate the other states again.
return FormView.get(self, self.request, self.args, self.kwargs)