p.save()
return self.poem_set.filter(for_contest=True)
+ def contest_poems(self):
+ return self.poem_set.filter(in_contest=True)
+
class Poem(models.Model):
slug = models.SlugField(max_length=50, db_index=True)
def __unicode__(self):
oneliner = u"%s, %s" % (self.poet.name, self.pretty_title())
- if not self.title:
- oneliner += u" [%s…]" % self.text[:20]
+ oneliner += u" [%s…]" % (u" ".join(self.text.split()[:5]))
return oneliner
def get_absolute_url(self):