X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/ef5668164de18104fe96141b18d0086ef5dc8316..8315186b58e7fb5ff12472eff11fb6e0a789a51e:/contrib/penfield/models.py diff --git a/contrib/penfield/models.py b/contrib/penfield/models.py index 8d7e3ff..ec8ba69 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'] @@ -53,6 +56,9 @@ class BlogView(MultiView): 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('',