Created
June 25, 2012 20:36
List model for project grehelper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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