Mercurial > public > sg101
comparison 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 |
comparison
equal
deleted
inserted
replaced
0:900ba3c7b765 | 1:dbd703f7d63a |
---|---|
1 """ | |
2 Models for the shoutbox application. | |
3 """ | |
4 from django.db import models | |
5 from django.contrib.auth.models import User | |
6 | |
7 class Shout(models.Model): | |
8 user = models.ForeignKey(User) | |
9 shout_date = models.DateTimeField(auto_now_add=True) | |
10 shout = models.TextField() | |
11 | |
12 def __unicode__(self): | |
13 shout = self.shout[:60] | |
14 return u'Shout from %s: %s' % (self.user.username, shout) | |
15 | |
16 class Meta: | |
17 ordering = ('-shout_date', ) |