- def index_view(self, request, node=None, extra_context=None):
- paginator, page, entries = paginate(self.blog.entries.all(), self.entries_per_page, request.GET.get('page', 1))
- context = {}
- context.update(extra_context or {})
- context.update({'blog': self.blog, 'paginator': paginator, 'paginated_page': page, 'entries': entries})
- return self.index_page.render_to_response(node, request, extra_context=context)
-
- def entry_view(self, request, slug, year=None, month=None, day=None, node=None, extra_context=None):
- entries = self.blog.entries.all()
- if year:
- entries = entries.filter(date__year=year)
- if month:
- entries = entries.filter(date__month=month)
- if day:
- entries = entries.filter(date__day=day)
- try:
- entry = entries.get(slug=slug)
- except:
- raise Http404
- context = {}
- context.update(extra_context or {})
- context.update({'blog': self.blog, 'entry': entry})
- return self.entry_page.render_to_response(node, request, extra_context=context)
+ def get_all_entries(self, request, extra_context=None):
+ return self.blog.entries.all(), extra_context