Update templates

This commit is contained in:
Nyymix 2025-01-13 21:09:29 +02:00
parent 0c00bc20df
commit e19776aae3
9 changed files with 113 additions and 20 deletions

View file

@ -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)