data() considered harmful
[edumed.git] / catalogue / views.py
1 import os.path
2 from django.conf import settings
3 from django.views.generic import DetailView, ListView
4 from .models import Lesson, Section
5
6 class SectionView(ListView):
7     model = Section
8
9     def get_context_data(self, **kwargs):
10         context = super(SectionView, self).get_context_data(**kwargs)
11         context['appendix'] = Lesson.objects.filter(type='appendix')
12         context['package_url'] = os.path.join(settings.MEDIA_URL, settings.CATALOGUE_PACKAGE)
13         context['package_student_url'] = os.path.join(settings.MEDIA_URL, settings.CATALOGUE_PACKAGE_STUDENT)
14         return context