+ def add_item(self, feed, obj, kwargs=None):
+ defaults = {
+ 'title': obj.title,
+ 'description': obj.content,
+ 'author_name': obj.author.get_full_name(),
+ 'pubdate': obj.date
+ }
+ defaults.update(kwargs or {})
+ super(BlogView, self).add_item(feed, obj, defaults)
+
+ def get_feed(self, feed_type, extra_context, kwargs=None):
+ tags = (extra_context or {}).get('tags', None)
+ title = self.blog.title
+
+ if tags is not None:
+ title += " - %s" % ', '.join([tag.name for tag in tags])
+
+ defaults = {
+ 'title': title
+ }
+ defaults.update(kwargs or {})
+ return super(BlogView, self).get_feed(feed_type, extra_context, defaults)
+
+ def entry_view(self, request, slug, year=None, month=None, day=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 = self.get_context()
+ context.update(extra_context or {})
+ context.update({'entry': entry})
+ return self.entry_page.render_to_response(request, extra_context=context)
+
+ def tag_archive_view(self, request, extra_context=None):