Fix views & update templates
This commit is contained in:
parent
3029eea1a0
commit
bd12a0abef
5 changed files with 24 additions and 6 deletions
|
@ -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}'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue