annotate gpp/shoutbox/models.py @ 1:dbd703f7d63a

Initial import of sg101 stuff from private repository.
author gremmie
date Mon, 06 Apr 2009 02:43:12 +0000
parents
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', )