def get_context_data(self, **kwargs):
context = super(LCTimeslotQuestionsView, self
).get_context_data(**kwargs)
tsid = context.get('tsid')
lc_timeslot = models.LiveCourseTimeSlot.objects.filter(pk=tsid).first()
context['lc_timeslot'] = lc_timeslot
if not lc_timeslot:
context['error_msg'] = "??????"
return context
lecturer = self.get_lecturer()
lc = lc_timeslot.live_course
context['course_name'] = lc.name
context['lecturer_name'] = lc.lecturer.name
context['date'] = timezone.localtime(
lc_timeslot.start).strftime('%Y-%m-%d')
context['start'] = timezone.localtime(
lc_timeslot.start).strftime('%H:%M')
context['end'] = timezone.localtime(
lc_timeslot.end).strftime('%H:%M')
old_groups = lc_timeslot.question_groups.filter(deleted=False)
context['old_groups'] = old_groups
return context
评论列表
文章目录