class NewsletterIssue(Entity, Titled):
newsletter = models.ForeignKey(Newsletter, related_name='issues')
class NewsletterIssue(Entity, Titled):
newsletter = models.ForeignKey(Newsletter, related_name='issues')
- ordering = ['-number']
- unique_together = (('newsletter', 'number'),)
+ ordering = ['-numbering']
+ unique_together = (('newsletter', 'numbering'),)
return reverse(self.article_view, urlconf=self, kwargs=kwargs)
elif isinstance(obj, NewsletterIssue):
if obj.newsletter == self.newsletter:
return reverse(self.article_view, urlconf=self, kwargs=kwargs)
elif isinstance(obj, NewsletterIssue):
if obj.newsletter == self.newsletter:
raise ViewCanNotProvideSubpath
@property
def urlpatterns(self):
urlpatterns = patterns('',
url(r'^', include(self.feed_patterns(self.get_all_articles, self.index_page, 'index'))),
raise ViewCanNotProvideSubpath
@property
def urlpatterns(self):
urlpatterns = patterns('',
url(r'^', include(self.feed_patterns(self.get_all_articles, self.index_page, 'index'))),
- url(r'^(?:%s)/(?P<number>\d+)/' % self.issue_permalink_base, include(self.feed_patterns(self.get_articles_by_issue, self.issue_page, 'issue')))
+ url(r'^(?:%s)/(?P<numbering>.+)/' % self.issue_permalink_base, include(self.feed_patterns(self.get_articles_by_issue, self.issue_page, 'issue')))
)
if self.issue_archive_page:
urlpatterns += patterns('',
)
if self.issue_archive_page:
urlpatterns += patterns('',
- def get_articles_by_issue(self, request, number, node=None, extra_context=None):
+ def get_articles_by_issue(self, request, numbering, node=None, extra_context=None):