mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
Fix books default ordering
This commit is contained in:
20
ram/bookshelf/migrations/0005_alter_book_options.py
Normal file
20
ram/bookshelf/migrations/0005_alter_book_options.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 4.2.5 on 2023-10-03 19:57
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookshelf", "0004_rename_numbers_of_pages_book_number_of_pages"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="book",
|
||||
options={
|
||||
"ordering": ["authors__last_name", "title"],
|
||||
"verbose_name_plural": "Rolling stock",
|
||||
},
|
||||
),
|
||||
]
|
@@ -52,6 +52,10 @@ class Book(models.Model):
|
||||
creation_time = models.DateTimeField(auto_now_add=True)
|
||||
updated_time = models.DateTimeField(auto_now=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ["authors__last_name", "title"]
|
||||
verbose_name_plural = "Rolling stock"
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
|
Reference in New Issue
Block a user