Mercurial > public > sg101
annotate gpp/shoutbox/models.py @ 7:ca66189c7c44
Added tiny_mce to the GPP_THIRD_PARTY_JS setting. Updated code to use it.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 12 Apr 2009 00:31:36 +0000 |
parents | dbd703f7d63a |
children | 777451a98f9d |
rev | line source |
---|---|
gremmie@1 | 1 """ |
gremmie@1 | 2 Models for the shoutbox application. |
gremmie@1 | 3 """ |
gremmie@1 | 4 from django.db import models |
gremmie@1 | 5 from django.contrib.auth.models import User |
gremmie@1 | 6 |
gremmie@1 | 7 class Shout(models.Model): |
gremmie@1 | 8 user = models.ForeignKey(User) |
gremmie@1 | 9 shout_date = models.DateTimeField(auto_now_add=True) |
gremmie@1 | 10 shout = models.TextField() |
gremmie@1 | 11 |
gremmie@1 | 12 def __unicode__(self): |
gremmie@1 | 13 shout = self.shout[:60] |
gremmie@1 | 14 return u'Shout from %s: %s' % (self.user.username, shout) |
gremmie@1 | 15 |
gremmie@1 | 16 class Meta: |
gremmie@1 | 17 ordering = ('-shout_date', ) |