From 3ff6b7cb51766411a72f486fdb5e08deb26abd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Mon, 9 Oct 2023 23:05:32 +0200 Subject: [PATCH] Fix bookshelf default sorting --- ram/bookshelf/models.py | 6 ++++++ ram/ram/__init__.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ram/bookshelf/models.py b/ram/bookshelf/models.py index 112c68f..0d01d10 100644 --- a/ram/bookshelf/models.py +++ b/ram/bookshelf/models.py @@ -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}" diff --git a/ram/ram/__init__.py b/ram/ram/__init__.py index f965868..55b01db 100644 --- a/ram/ram/__init__.py +++ b/ram/ram/__init__.py @@ -1,4 +1,4 @@ from ram.utils import git_suffix -__version__ = "0.6.4" +__version__ = "0.6.5" __version__ += git_suffix(__file__)