+ feed_suffix = models.CharField(max_length=255, blank=False, default=FeedMultiViewMixin.feed_suffix)
+ feeds_enabled = models.BooleanField()
+
+ @property
+ def feed_title(self):
+ return self.newsletter.title
+
+ def get_subpath(self, obj):
+ if isinstance(obj, NewsletterArticle):
+ if obj.newsletter == self.newsletter:
+ kwargs = {'slug': obj.slug}
+ if self.article_permalink_style in 'DMY':
+ kwargs.update({'year': str(obj.date.year).zfill(4)})
+ if self.article_permalink_style in 'DM':
+ kwargs.update({'month': str(obj.date.month).zfill(2)})
+ if self.article_permalink_style == 'D':
+ kwargs.update({'day': str(obj.date.day).zfill(2)})
+ return reverse(self.article_view, urlconf=self, kwargs=kwargs)
+ elif isinstance(obj, NewsletterIssue):
+ if obj.newsletter == self.newsletter:
+ return reverse('issue', urlconf=self, kwargs={'number': str(obj.number)})
+ raise ViewCanNotProvideSubpath
+