annotate gpp/shoutbox/models.py @ 12:f408971657b9

Changed the shoutbox: posts are now made by Ajax. The smiley farm is loaded only on demand. jQuery is now in the base template. May add scrolling later.
author Brian Neal <bgneal@gmail.com>
date Wed, 15 Apr 2009 01:13:17 +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', )