+ feed_suffix = models.CharField(max_length=255, blank=False, default=FeedMultiViewMixin.feed_suffix)
+ feeds_enabled = models.BooleanField()
+ list_var = 'entries'
+
+ def __unicode__(self):
+ return u'BlogView for %s' % self.blog.title
+
+ @property
+ def per_page(self):
+ return self.entries_per_page
+
+ def get_reverse_params(self, obj):
+ if isinstance(obj, BlogEntry):
+ if obj.blog == self.blog:
+ kwargs = {'slug': obj.slug}
+ if self.entry_permalink_style in 'DMY':
+ kwargs.update({'year': str(obj.date.year).zfill(4)})
+ if self.entry_permalink_style in 'DM':
+ kwargs.update({'month': str(obj.date.month).zfill(2)})
+ if self.entry_permalink_style == 'D':
+ kwargs.update({'day': str(obj.date.day).zfill(2)})
+ return self.entry_view, [], kwargs
+ elif isinstance(obj, Tag):
+ if obj in self.blog.entry_tags:
+ return 'entries_by_tag', [], {'tag_slugs': obj.slug}
+ elif isinstance(obj, (date, datetime)):
+ kwargs = {
+ 'year': str(obj.year).zfill(4),
+ 'month': str(obj.month).zfill(2),
+ 'day': str(obj.day).zfill(2)
+ }
+ return 'entries_by_day', [], kwargs
+ raise ViewCanNotProvideSubpath
+
+ def get_context(self):
+ return {'blog': self.blog}