예제 #1
0
 def get_context_data(self, **kwargs):
     context_data = super(TagPostsView, self).get_context_data(**kwargs)
     context_data['tag'] = self.tag
     context_data['page_range'] = GenericPaginator(
         self.get_queryset(), self.paginate_by,
         self.request.GET.get('page')).get_page_range()
     return context_data
예제 #2
0
 def get_context_data(self, **kwargs):
     context_data = super(HomepageView, self).get_context_data(**kwargs)
     context_data['page_range'] = GenericPaginator(
         self.queryset,
         self.paginate_by,
         self.request.GET.get('page')
     ).get_page_range()
     return context_data