mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 21:27:49 +02:00
Change model default sort for Book
This commit is contained in:
17
ram/bookshelf/migrations/0007_alter_book_options.py
Normal file
17
ram/bookshelf/migrations/0007_alter_book_options.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Generated by Django 4.2.5 on 2023-10-03 21:07
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("bookshelf", "0006_alter_book_isbn"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name="book",
|
||||||
|
options={"ordering": ["title"]},
|
||||||
|
),
|
||||||
|
]
|
@@ -53,7 +53,7 @@ class Book(models.Model):
|
|||||||
updated_time = models.DateTimeField(auto_now=True)
|
updated_time = models.DateTimeField(auto_now=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ["authors__last_name", "title"]
|
ordering = ["title"]
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
Reference in New Issue
Block a user