Added philo 404 handling via a relationship named Http404 on nodes. Uses the passthro...
[philo.git] / contrib / penfield / models.py
index e433b84..33eecb0 100644 (file)
@@ -65,7 +65,8 @@ class BlogView(MultiView, FeedMultiViewMixin):
        entry_permalink_base = models.CharField(max_length=255, blank=False, default='entries')
        tag_permalink_base = models.CharField(max_length=255, blank=False, default='tags')
        feed_suffix = models.CharField(max_length=255, blank=False, default=FeedMultiViewMixin.feed_suffix)
-       feeds_enabled = models.BooleanField() 
+       feeds_enabled = models.BooleanField()
+       list_var = 'entries'
        
        def __unicode__(self):
                return u'BlogView for %s' % self.blog.title
@@ -239,6 +240,7 @@ class NewsletterArticle(Entity, Titled):
        date = models.DateTimeField(default=datetime.now)
        lede = models.TextField(null=True, blank=True)
        full_text = models.TextField()
+       tags = models.ManyToManyField(Tag, related_name='newsletterarticles', blank=True, null=True)
        
        class Meta:
                get_latest_by = 'date'
@@ -284,6 +286,7 @@ class NewsletterView(MultiView, FeedMultiViewMixin):
        
        feed_suffix = models.CharField(max_length=255, blank=False, default=FeedMultiViewMixin.feed_suffix)
        feeds_enabled = models.BooleanField()
+       list_var = 'articles'
        
        @property
        def feed_title(self):
@@ -386,9 +389,9 @@ class NewsletterView(MultiView, FeedMultiViewMixin):
                        article = articles.get(slug=slug)
                except:
                        raise Http404
-               context = {}
+               context = self.get_context()
                context.update(extra_context or {})
-               context.update({'newsletter': self.newsletter, 'article': article})
+               context.update({'article': article})
                return self.article_page.render_to_response(node, request, extra_context=context)
        
        def issue_archive_view(self, request, node=None, extra_context=None):