Fix bookshelf default sorting

This commit is contained in:
2023-10-09 23:05:32 +02:00
parent 424b17ae58
commit 764240d67a
3 changed files with 27 additions and 1 deletions

View File

@@ -16,6 +16,9 @@ class Publisher(models.Model):
country = CountryField(blank=True)
website = models.URLField(blank=True)
class Meta:
ordering = ["name"]
def __str__(self):
return self.name
@@ -24,6 +27,9 @@ class Author(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
class Meta:
ordering = ["last_name", "first_name"]
def __str__(self):
return f"{self.last_name}, {self.first_name}"