本文整理汇总了Python中django.views.generic.edit.CreateView.get_context_data方法的典型用法代码示例。如果您正苦于以下问题:Python CreateView.get_context_data方法的具体用法?Python CreateView.get_context_data怎么用?Python CreateView.get_context_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类django.views.generic.edit.CreateView
的用法示例。
在下文中一共展示了CreateView.get_context_data方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
context = CreateView.get_context_data(self, **kwargs)
context['action'] = reverse('rol_permisos')
if self.templ_base_error:
context['nodefault'] = self.templ_base_error
context['errormensaje'] = self.mensaje
return context
示例2: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
context = CreateView.get_context_data(self, **kwargs)
context["action"] = reverse("relacion_crear", kwargs={"idproyecto": self.kwargs["idproyecto"]})
if not self.valido:
context["nodefault"] = "__panel.html"
return context
示例3: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
context = CreateView.get_context_data(self, **kwargs)
context['idfase'] = self.kwargs['idfase']
context['action'] = reverse('item_crear', kwargs={'idfase': self.kwargs['idfase']})
if self.ocurrio_error :
context['nodefault'] = '__panel.html'
return context
示例4: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
data = CreateView.get_context_data(self, **kwargs)
product = get_object_or_404(Product, pk=self.kwargs['pk'])
data['product'] = product
data['user'] = self.request.user
if product.courier:
data['courier'] = Courier.objects.get(pk=product.courier)
data['comment_list'] = product.comment_set.all().order_by('id')
data['comment_form'] = CommentForm(initial={'user': self.request.user, 'product': product})
data['hardware_comment_form'] = CommentForm(initial={'user': self.request.user, 'product': product})
return data
示例5: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
context = CreateView.get_context_data(self, **kwargs)
tipo = int(self.request.GET.get('tipo', '10'))
tipos = Solicitacao.TIPO_SOLICITACAO_CHOICE
context['title'] = _(
'Registar uma Solicitação: (%s)') % tipos.triple_map[tipo]['text']
context['bg_title'] = opts_bg[tipo]
return context
示例6: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
context = CreateView.get_context_data(self, **kwargs)
context['client'] = get_object_or_404(Client, pk=self.kwargs['client_id'])
return context
示例7: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
context = CreateView.get_context_data(self, **kwargs)
context['object_list'] = Room.objects.order_by('-created')
return context
示例8: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
context = CreateView.get_context_data(self, **kwargs)
context['article'] = get_object_or_404(Article, pk=self.kwargs['article_id'])
return context
示例9: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
context = CreateView.get_context_data(self, **kwargs)
context['honeypot_class'] = context['form'].honeypot_class
context['honeypot_jsfunction'] = context['form'].honeypot_jsfunction
return context
示例10: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
context = CreateView.get_context_data(self, **kwargs)
context['action'] = reverse('itematributo_crear',kwargs={'idtipoitem':self.kwargs['idtipoitem'] })
if self.templ_base_error:
context['nodefault'] = self.templ_base_error
return context
示例11: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
context = CreateView.get_context_data(self, **kwargs)
context['action']= reverse('comite_crear',kwargs={'idproyecto':self.kwargs['idproyecto'] })
#if self.ocurrio_error:
#context['nodefault'] = '__panel.html'
return context
示例12: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
kwargs = CreateView.get_context_data(self, **kwargs)
kwargs = InlineFormMixin.get_context_data(self, **kwargs)
return kwargs
示例13: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
context = djCreateView.get_context_data(self, **kwargs)
context['laboratory'] = self.lab
return context
示例14: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
context = CreateView.get_context_data(self, **kwargs)
context['author'] = self.kwargs['pk']
return context
示例15: get_context_data
# 需要导入模块: from django.views.generic.edit import CreateView [as 别名]
# 或者: from django.views.generic.edit.CreateView import get_context_data [as 别名]
def get_context_data(self, **kwargs):
context = CreateView.get_context_data(self, **kwargs)
context["event"] = Event.objects.get(id=1)
context["volunteers"] = Volunteer.objects.all()
return context