当前位置: 首页>>代码示例>>Python>>正文


Python CreateView.get_context_data方法代码示例

本文整理汇总了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
开发者ID:nelsondspy,项目名称:projectmn,代码行数:9,代码来源:views.py

示例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
开发者ID:nelsondspy,项目名称:projectmn,代码行数:9,代码来源:view_itemrelacion.py

示例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
开发者ID:nelsondspy,项目名称:projectmn,代码行数:9,代码来源:view_item.py

示例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
开发者ID:owad,项目名称:service,代码行数:13,代码来源:views.py

示例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
开发者ID:cmjatai,项目名称:cmj,代码行数:15,代码来源:views.py

示例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
开发者ID:owad,项目名称:files-storage,代码行数:6,代码来源:views.py

示例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
开发者ID:bookug,项目名称:ernst,代码行数:6,代码来源:views.py

示例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
开发者ID:owad,项目名称:owadblog,代码行数:6,代码来源:views.py

示例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
开发者ID:bsimic0001,项目名称:django-wiki,代码行数:7,代码来源:accounts.py

示例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
开发者ID:nelsondspy,项目名称:projectmn,代码行数:8,代码来源:view_itematributo.py

示例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
开发者ID:nelsondspy,项目名称:projectmn,代码行数:8,代码来源:view_comite.py

示例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
开发者ID:rterehov,项目名称:django-extra-cbv,代码行数:6,代码来源:inline.py

示例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
开发者ID:solvo,项目名称:organilab,代码行数:6,代码来源:djgeneric.py

示例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
开发者ID:c35sys,项目名称:books,代码行数:6,代码来源:views.py

示例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
开发者ID:InnovAfrica,项目名称:django-volunteer,代码行数:7,代码来源:views.py


注:本文中的django.views.generic.edit.CreateView.get_context_data方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。