Exemple #1
0
 def get(self, request):
     context = base_context(request)
     context['text_form'] = BiblForms.TextForm
     context['textbook_form'] = BiblForms.TextbookForm
     context['fiction_form'] = BiblForms.FictionForm
     context['press_form'] = BiblForms.PressForm
     return render(request, 'bibliography_form.html', context)
Exemple #2
0
    def get(self, request, page=1):
        biblg_list = Bibliography.objects.all().order_by('-update_date')
        paginator = Paginator(biblg_list, 10)

        try:
            biblgs = paginator.page(page)
        except PageNotAnInteger:
            biblgs = paginator.page(1)
        except EmptyPage:
            biblgs = paginator.page(paginator.num_pages)

        context = base_context(request)
        context['biblg_list'] = biblgs

        return render(request, 'bibliography_list.html', context)
Exemple #3
0
    def get(self, request, type='textbook', page=1):
        if type == 'textbook':
            biblg_list = Textbook.objects.all().order_by('-update_date')
        elif type == 'fiction':
            biblg_list = Fiction.objects.all().order_by('-update_date')
        elif type == 'press':
            biblg_list = Press.objects.all().order_by('-update_date')

        paginator = Paginator(biblg_list, 10)

        try:
            biblgs = paginator.page(page)
        except PageNotAnInteger:
            biblgs = paginator.page(1)
        except EmptyPage:
            biblgs = paginator.page(paginator.num_pages)

        context = base_context(request)
        context['biblg_list'] = biblgs
        context['type'] = type

        return render(request, 'bibliography_list.html', context)
Exemple #4
0
    def get(self, request, page=1):
        context = base_context(request)

        return render(request, 'bibliography.html', context)