Update templates
This commit is contained in:
parent
0c00bc20df
commit
e19776aae3
9 changed files with 113 additions and 20 deletions
|
@ -15,6 +15,10 @@ class Album(models.Model):
|
|||
cover = models.ImageField(upload_to="covers/", blank=True, null=True, verbose_name="Album Cover")
|
||||
is_public = models.BooleanField(default=False, verbose_name="Published")
|
||||
|
||||
@property
|
||||
def photos_in_album(self):
|
||||
return self.photos.count()
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if not self.slug:
|
||||
self.slug = slugify(self.name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue