- def index_view(self, request, node=None, extra_context=None):
- entries = self.blog.entries.all()
- if self.entries_per_page:
- paginated_page = paginate(request, entries, self.entries_per_page)
- entries = paginated_page.object_list
- else:
- paginated_page = None
- context = {}
- context.update(extra_context or {})
- context.update({'blog': self.blog, 'entries': entries, 'paginated_page': paginated_page})
- 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, node=None, extra_context=None):
+ return self.blog.entries.all(), extra_context