summaryrefslogtreecommitdiff
path: root/app/books/admin.py
blob: 8d94651f5fec26e748fb99fbb484cf9f77b2f3b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from django.contrib import admin
from .models import Book, BookHighlight


@admin.register(Book)
class BookAdmin(admin.ModelAdmin):
    list_display = ('title', 'admin_thumbnail', 'rating', 'isbn', 'author_name', 'read_date', 'publish_date')
    search_fields = ['title', 'body_markdown']
    list_filter = ('rating', 'read_date')

    class Media:
        js = ('next-prev-links.js',)


@admin.register(BookHighlight)
class BookHighlightAdmin(admin.ModelAdmin):
    list_display = ('book', 'page', 'date_added')