Fix views & update templates

This commit is contained in:
Nyymix 2025-04-11 22:38:20 +03:00
parent 3029eea1a0
commit bd12a0abef
5 changed files with 24 additions and 6 deletions

View file

@ -69,6 +69,10 @@ class Photo(models.Model):
unique_together = ('album', "slug")
verbose_name_plural = "Photos"
ordering = ('-taken_at',)
indexes = [
models.Index(fields=['views']),
models.Index(fields=['likes']),
]
def __str__(self):
return f'{self.slug} ({self.orientation}) {self.is_favorite}'