diff --git a/vrobbler/apps/books/admin.py b/vrobbler/apps/books/admin.py index f2cc3bd..e61c12a 100644 --- a/vrobbler/apps/books/admin.py +++ b/vrobbler/apps/books/admin.py @@ -1,7 +1,5 @@ +from books.models import Author, Book, Paper from django.contrib import admin - -from books.models import Author, Book, Page - from scrobbles.admin import ScrobbleInline @@ -18,13 +16,6 @@ class AuthorAdmin(admin.ModelAdmin): search_fields = ("name",) -@admin.register(Page) -class PageAdmin(admin.ModelAdmin): - date_hierarchy = "created" - list_filter = ("book",) - ordering = ("book", "number") - - @admin.register(Book) class BookAdmin(admin.ModelAdmin): date_hierarchy = "created" @@ -40,3 +31,20 @@ class BookAdmin(admin.ModelAdmin): inlines = [ ScrobbleInline, ] + + +@admin.register(Paper) +class BookAdmin(admin.ModelAdmin): + date_hierarchy = "created" + list_display = ( + "title", + "subtitle", + "arxiv_id", + "first_publish_year", + "pages", + ) + search_fields = ("name",) + ordering = ("-created",) + inlines = [ + ScrobbleInline, + ]