Mercurial > public > sg101
comparison potd/models.py @ 695:2d35e5f97a99
In process work for #50. Started a user_photos application.
Initial commit with model, form, and view. The view doesn't save the photo yet.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 07 Sep 2013 20:50:46 -0500 |
parents | ee87ea74d46b |
children | eeaf387803c6 |
comparison
equal
deleted
inserted
replaced
694:d84aaf239182 | 695:2d35e5f97a99 |
---|---|
30 """Model to represent a POTD""" | 30 """Model to represent a POTD""" |
31 photo = models.ImageField(upload_to='potd/%Y/%m/%d') | 31 photo = models.ImageField(upload_to='potd/%Y/%m/%d') |
32 thumb = models.ImageField(upload_to='potd/%Y/%m/%d/thumbs', blank=True, null=True) | 32 thumb = models.ImageField(upload_to='potd/%Y/%m/%d/thumbs', blank=True, null=True) |
33 caption = models.CharField(max_length=128) | 33 caption = models.CharField(max_length=128) |
34 description = models.TextField() | 34 description = models.TextField() |
35 user = models.ForeignKey(User) | 35 user = models.ForeignKey(User, related_name='potd_set') |
36 date_added = models.DateField() | 36 date_added = models.DateField() |
37 potd_count = models.IntegerField(default=0) | 37 potd_count = models.IntegerField(default=0) |
38 | 38 |
39 class Meta: | 39 class Meta: |
40 ordering = ('-date_added', '-caption') | 40 ordering = ('-date_added', '-caption') |