X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/819fc766fd18514fdd45cf514efdd91739210e62..19a7dc68c1e08655d53672a2527b39c38efe1f9b:/philo/contrib/penfield/models.py?ds=inline diff --git a/philo/contrib/penfield/models.py b/philo/contrib/penfield/models.py index 5e2fdbf..c2edd8d 100644 --- a/philo/contrib/penfield/models.py +++ b/philo/contrib/penfield/models.py @@ -200,8 +200,8 @@ class BlogView(FeedView): return {'blog': self.blog} def get_entry_queryset(self): - """Returns the default :class:`QuerySet` of :class:`BlogEntry` instances for the :class:`BlogView`.""" - return self.blog.entries.all() + """Returns the default :class:`QuerySet` of :class:`BlogEntry` instances for the :class:`BlogView` - all entries that are considered posted in the past. This allows for scheduled posting of entries.""" + return self.blog.entries.filter(date__lte=datetime.now()) def get_tag_queryset(self): """Returns the default :class:`QuerySet` of :class:`.Tag`\ s for the :class:`BlogView`'s :meth:`get_entries_by_tag` and :meth:`tag_archive_view`.""" @@ -486,9 +486,7 @@ class NewsletterView(FeedView): url(r'^%s$' % self.issue_permalink_base, self.issue_archive_view, 'issue_archive') ) if self.article_archive_page: - urlpatterns += patterns('', - url(r'^%s' % self.article_permalink_base, include(self.feed_patterns('get_all_articles', 'article_archive_page', 'articles'))) - ) + urlpatterns += self.feed_patterns(r'^%s' % self.article_permalink_base, 'get_all_articles', 'article_archive_page', 'articles') if self.article_permalink_style in 'DMY': urlpatterns += self.feed_patterns(r'^%s/(?P\d{4})' % self.article_permalink_base, 'get_articles_by_ymd', 'article_archive_page', 'articles_by_year') if self.article_permalink_style in 'DM': @@ -519,8 +517,8 @@ class NewsletterView(FeedView): return {'newsletter': self.newsletter} def get_article_queryset(self): - """Returns the default :class:`QuerySet` of :class:`NewsletterArticle` instances for the :class:`NewsletterView`.""" - return self.newsletter.articles.all() + """Returns the default :class:`QuerySet` of :class:`NewsletterArticle` instances for the :class:`NewsletterView` - all articles that are considered posted in the past. This allows for scheduled posting of articles.""" + return self.newsletter.articles.filter(date__lte=datetime.now()) def get_issue_queryset(self): """Returns the default :class:`QuerySet` of :class:`NewsletterIssue` instances for the :class:`NewsletterView`."""