2 from django.conf import settings
3 from django.views.generic import DetailView, ListView
4 from .models import Lesson, Section
7 class SectionView(ListView):
10 def get_context_data(self, **kwargs):
11 context = super(SectionView, self).get_context_data(**kwargs)
12 context['appendix'] = Lesson.objects.filter(type='appendix')
13 context['package_url'] = os.path.join(settings.MEDIA_URL, settings.CATALOGUE_PACKAGE)
14 context['package_student_url'] = os.path.join(settings.MEDIA_URL, settings.CATALOGUE_PACKAGE_STUDENT)
18 class LessonView(DetailView):
21 def get_template_names(self):
23 'catalogue/lesson/%s/lesson_detail.html' % self.object.type,
24 'catalogue/lesson/lesson_detail.html',