X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/1ff9f3bdbf09e3a7d2a478472ddd5ad73af1d45e..06fb2d046af27bb3f443e88cd42062874c294cb3:/philo/contrib/penfield/models.py diff --git a/philo/contrib/penfield/models.py b/philo/contrib/penfield/models.py index c22dcfc..3a8e82f 100644 --- a/philo/contrib/penfield/models.py +++ b/philo/contrib/penfield/models.py @@ -5,7 +5,7 @@ from django.conf.urls.defaults import url, patterns, include from django.db import models from django.http import Http404, HttpResponse -from philo.contrib.syndication.models import FeedView +from philo.contrib.winer.models import FeedView from philo.exceptions import ViewCanNotProvideSubpath from philo.models import Tag, Entity, Page, register_value_model from philo.models.fields import TemplateField @@ -159,7 +159,7 @@ class BlogView(FeedView): @property def urlpatterns(self): urlpatterns = self.feed_patterns(r'^', 'get_all_entries', 'index_page', 'index') +\ - self.feed_patterns(r'^%s/(?P[-\w]+[-+/\w]*)$' % self.tag_permalink_base, 'get_entries_by_tag', 'tag_page', 'entries_by_tag') + self.feed_patterns(r'^%s/(?P[-\w]+[-+/\w]*)' % self.tag_permalink_base, 'get_entries_by_tag', 'tag_page', 'entries_by_tag') if self.tag_archive_page: urlpatterns += patterns('', @@ -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`.""" @@ -285,7 +285,7 @@ class BlogView(FeedView): def inner(request, extra_context=None, *args, **kwargs): obj = self.get_object(request, *args, **kwargs) - feed = self.get_feed(obj, request, reverse_name, feed_type) + feed = self.get_feed(obj, request, reverse_name, feed_type, *args, **kwargs) items, extra_context = get_items(request, extra_context=extra_context, *args, **kwargs) self.populate_feed(feed, items, request) @@ -519,8 +519,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`."""