X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/ef5668164de18104fe96141b18d0086ef5dc8316..cc2232ac1fe0497203e386521cb91c01c83060ea:/contrib/penfield/models.py?ds=inline diff --git a/contrib/penfield/models.py b/contrib/penfield/models.py index 8d7e3ff..d1695e7 100644 --- a/contrib/penfield/models.py +++ b/contrib/penfield/models.py @@ -15,13 +15,16 @@ class Blog(Entity, Titled): return Tag.objects.filter(blogentries__blog=self) +register_value_model(Blog) + + class BlogEntry(Entity, Titled): blog = models.ForeignKey(Blog, related_name='entries') author = models.ForeignKey(getattr(settings, 'PHILO_PERSON_MODULE', 'auth.User'), related_name='blogentries') date = models.DateTimeField(default=datetime.now) content = models.TextField() - excerpt = models.TextField() - tags = models.ManyToManyField(Tag, related_name='blogentries') + excerpt = models.TextField(blank=True, null=True) + tags = models.ManyToManyField(Tag, related_name='blogentries', blank=True, null=True) class Meta: ordering = ['-date'] @@ -47,12 +50,15 @@ 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') tag_permalink_base = models.CharField(max_length=255, blank=False, default='tags') + def __unicode__(self): + return u'BlogView for %s' % self.blog.title + @property def urlpatterns(self): base_patterns = patterns('',