X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/8315186b58e7fb5ff12472eff11fb6e0a789a51e..4bf662d52cdef84ebc3eea50213f576a72b30abf:/contrib/penfield/models.py?ds=sidebyside diff --git a/contrib/penfield/models.py b/contrib/penfield/models.py index ec8ba69..4273165 100644 --- a/contrib/penfield/models.py +++ b/contrib/penfield/models.py @@ -12,7 +12,7 @@ class Blog(Entity, Titled): @property def entry_tags(self): """ Returns a QuerySet of Tags that are used on any entries in this blog. """ - return Tag.objects.filter(blogentries__blog=self) + return Tag.objects.filter(blogentries__blog=self).distinct() register_value_model(Blog) @@ -50,7 +50,7 @@ class BlogView(MultiView): entry_archive_page = models.ForeignKey(Page, related_name='blog_entry_archive_related', null=True, blank=True) tag_page = models.ForeignKey(Page, related_name='blog_tag_related') tag_archive_page = models.ForeignKey(Page, related_name='blog_tag_archive_related', null=True, blank=True) - entries_per_page = models.IntegerField(blank=True, validators=[validate_pagination_count]) + entries_per_page = models.IntegerField(blank=True, validators=[validate_pagination_count], null=True) entry_permalink_style = models.CharField(max_length=1, choices=ENTRY_PERMALINK_STYLE_CHOICES) entry_permalink_base = models.CharField(max_length=255, blank=False, default='entries') @@ -146,7 +146,7 @@ class BlogView(MultiView): def tag_view(self, request, tag, node=None, extra_context=None): try: - tag = self.blog.entry_tags.filter(slug=tag) + tag = self.blog.entry_tags.get(slug=tag) except: raise Http404 entries = self.blog.entries.filter(tags=tag)