Skip to content

Instantly share code, notes, and snippets.

@yyl
Created June 25, 2012 20:36
List model for project grehelper
class List(models.Model):
name = models.CharField(max_length=200, unique=True)
start_date = models.DateTimeField(verbose_name='date started',
default=datetime.now())
slug = models.SlugField(max_length=200, unique=True)
progress = models.FloatField(default=0.0,
validators=[MaxValueValidator(100.0),
MinValueValidator(0.0)])
def __unicode__(self):
return self.name
def get_absolute_url(self):
return "/list_%s/" % self.slug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment