本文整理汇总了Python中django.views.generic.edit.CreateView.get方法的典型用法代码示例。如果您正苦于以下问题:Python CreateView.get方法的具体用法?Python CreateView.get怎么用?Python CreateView.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类django.views.generic.edit.CreateView
的用法示例。
在下文中一共展示了CreateView.get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get [as 别名]
def get(self, request, *args, **kwargs):
self.master_object = self.get_master_object()
return CreateView.get(self, request, *args, **kwargs)
示例2: get
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get [as 别名]
def get(self, request, *args, **kwargs):
self.lab = kwargs['lab_pk']
return djCreateView.get(self, request, *args, **kwargs)
示例3: get
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get [as 别名]
def get(self, request, *args, **kwargs):
response = CreateView.get(self, request, *args, **kwargs)
if self.request.user.is_authenticated:
logout(request)
return response
示例4: get
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get [as 别名]
def get(self, request, *args, **kwargs):
return CreateView.get(self, request, *args, **kwargs)
示例5: get
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get [as 别名]
def get(self, request, *args, **kwargs):
if request.user.is_authenticated():
return HttpResponseRedirect(reverse('volunteer-update', args=[request.user.id]))
return CreateView.get(self, request, *args, **kwargs)