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


Python DetailView.get_context_data方法代码示例

本文整理汇总了Python中django.views.generic.detail.DetailView.get_context_data方法的典型用法代码示例。如果您正苦于以下问题:Python DetailView.get_context_data方法的具体用法?Python DetailView.get_context_data怎么用?Python DetailView.get_context_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在django.views.generic.detail.DetailView的用法示例。


在下文中一共展示了DetailView.get_context_data方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_context_data

# 需要导入模块: from django.views.generic.detail import DetailView [as 别名]
# 或者: from django.views.generic.detail.DetailView import get_context_data [as 别名]
 def get_context_data(self, **kwargs):
     context = DetailView.get_context_data(self, **kwargs)
     
             
     context['questions'] = self.object.get_ds_cau_hoi()
     
     return context
开发者ID:anhpt204,项目名称:tracnghiem,代码行数:9,代码来源:views.py

示例2: get_context_data

# 需要导入模块: from django.views.generic.detail import DetailView [as 别名]
# 或者: from django.views.generic.detail.DetailView import get_context_data [as 别名]
 def get_context_data(self, **kwargs):
     context = DetailView.get_context_data(self, **kwargs)
     category_slug = self.request.GET.get('cat', None)
     category = get_category_by_slug(category_slug)
     context['category'] = category
     context['next_project'] = self.get_object().next(category_slug)
     context['previous_project'] = self.get_object().previous(category_slug)
     return context
开发者ID:mmoravcik,项目名称:folioport,代码行数:10,代码来源:views.py

示例3: get_context_data

# 需要导入模块: from django.views.generic.detail import DetailView [as 别名]
# 或者: from django.views.generic.detail.DetailView import get_context_data [as 别名]
    def get_context_data(self, **kwargs):
        context = DetailView.get_context_data(self, **kwargs)


        context['khthi'] = self.object.khthi
        context['thi_sinh'] = self.object.thi_sinh
        context['khthi_dangthi'] = KHTHI_DANGTHI

        return context
开发者ID:anhpt204,项目名称:hvhc,代码行数:11,代码来源:views.py

示例4: get_context_data

# 需要导入模块: from django.views.generic.detail import DetailView [as 别名]
# 或者: from django.views.generic.detail.DetailView import get_context_data [as 别名]
 def get_context_data(self, **kwargs):
     context = DetailView.get_context_data(self, **kwargs)
     context['form'] = ProfileForm()
     return context
开发者ID:crazyface,项目名称:42-test-sorokin2,代码行数:6,代码来源:views.py

示例5: get_context_data

# 需要导入模块: from django.views.generic.detail import DetailView [as 别名]
# 或者: from django.views.generic.detail.DetailView import get_context_data [as 别名]
 def get_context_data(self, **kwargs):
     context = DetailView.get_context_data(self, **kwargs)
     obj = kwargs['object']
     context['comment_form'] = CommentForm()
     context['comments'] = obj.comments.all()
     return context
开发者ID:crazyface,项目名称:codeone-test,代码行数:8,代码来源:views.py

示例6: get_context_data

# 需要导入模块: from django.views.generic.detail import DetailView [as 别名]
# 或者: from django.views.generic.detail.DetailView import get_context_data [as 别名]
 def get_context_data( self, **kwargs ):
     ctx=DetailView.get_context_data( self, **kwargs )
     ctx.update({
         'bootstrapData': json.dumps(bootstrapSerializer( self.object )),
     })
     return ctx
开发者ID:yaylenny,项目名称:kimillion,代码行数:8,代码来源:views.py

示例7: get_context_data

# 需要导入模块: from django.views.generic.detail import DetailView [as 别名]
# 或者: from django.views.generic.detail.DetailView import get_context_data [as 别名]
 def get_context_data(self, **kwargs):
     forms = MultiFormView.construct_forms(self)
     data = DetailView.get_context_data(self, object=self.object)
     data.update(forms)
     data['EMAIL_TAGS'] = EMAIL_TAGS
     return data
开发者ID:jordanorc,项目名称:iaae,代码行数:8,代码来源:views.py

示例8: get_context_data

# 需要导入模块: from django.views.generic.detail import DetailView [as 别名]
# 或者: from django.views.generic.detail.DetailView import get_context_data [as 别名]
 def get_context_data(self, **kwargs):
     kwargs = DetailView.get_context_data(self, **kwargs)
     kwargs = InlineMixin.get_context_data(self, **kwargs)
     return kwargs
开发者ID:rterehov,项目名称:django-extra-cbv,代码行数:6,代码来源:inline.py

示例9: get_context_data

# 需要导入模块: from django.views.generic.detail import DetailView [as 别名]
# 或者: from django.views.generic.detail.DetailView import get_context_data [as 别名]
 def get_context_data(self, **kwargs):
     context = DetailView.get_context_data(self, **kwargs)
     context['testruns'] = TestRun.objects.filter(milestone=self.object)
     return context
开发者ID:willdom,项目名称:test-yango,代码行数:6,代码来源:views.py


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