Skip to content
Snippets Groups Projects
Verified Commit 97ca661b authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Add ordering to models. Advances BiscuIT-ng#54.

parent 7619dc0a
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,7 @@ class Book(SchoolRelated):
class Meta:
unique_together = [['school', 'title', 'author', 'edition', 'year']]
ordering = ['title', 'year', 'edition']
class BookCopy(models.Model):
......@@ -84,3 +85,6 @@ class BookCopy(models.Model):
def is_deleteable(self) -> bool:
return not self.borrow_count and not self.borrower
class Meta:
ordering = ['book__title', 'book__year', 'book__edition', 'copy_num']
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment