Source

lindyjam / quotes / models.py

Full commit
from django.db import models
import datetime

class Quote(models.Model):
    body = models.CharField('Quote Text', blank=False, max_length=160)
    submitted = models.DateTimeField(default=datetime.datetime.now)
    approved = models.BooleanField(default=False)
    
    def __unicode__(self):
        return u'%s' % (str(self.body),)
    
    def snippet(self):
        return self.body[:50] + ('...' if len(self.body) > 50 else '')