Rely on slugs to have a more natural sorting

This commit is contained in:
2025-05-04 22:46:23 +02:00
parent b81c63898f
commit b5c57dcd94
2 changed files with 31 additions and 3 deletions

View File

@@ -43,7 +43,7 @@ class Manufacturer(models.Model):
)
class Meta:
ordering = ["category", "name"]
ordering = ["category", "slug"]
def __str__(self):
return self.name
@@ -78,7 +78,7 @@ class Company(models.Model):
class Meta:
verbose_name_plural = "Companies"
ordering = ["name"]
ordering = ["slug"]
def __str__(self):
return self.name
@@ -207,7 +207,7 @@ class Tag(models.Model):
slug = models.CharField(max_length=128, unique=True)
class Meta:
ordering = ["name"]
ordering = ["slug"]
def __str__(self):
return self.name