def get_context_data(self, **kwargs):
context = super(DetailView, self).get_context_data(**kwargs)
fw_name = context['object'].name
try:
details = Features.objects.get(library_framework_name=fw_name)
fields = [(i.help_text,getattr(details, i.name)) for i in details._meta.fields if len(i.help_text) > 0]
context['details'] = fields
except:
pass
context['question_count'] = QuestionOnIt.get_count_for_lang(fw_name).count
context['jobs'] = Job.get_all_job_for(fw_name)
context['courses'] = Course.get_courses_for_lang(fw_name)
return context
评论列表
文章目录