X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/63c69d54bad19d7b1939b139ad79def1e7c3c194..dea27f4e683e78d64d7841489ac1059e6a7d98c9:/apps/pdcounter/admin.py diff --git a/apps/pdcounter/admin.py b/apps/pdcounter/admin.py new file mode 100644 index 000000000..f946cad00 --- /dev/null +++ b/apps/pdcounter/admin.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from django.contrib import admin + +from pdcounter.models import BookStub, Author + + +class BookStubAdmin(admin.ModelAdmin): + list_display = ('title', 'author', 'slug', 'pd') + search_fields = ('title','author') + ordering = ('title',) + + prepopulated_fields = {'slug': ('title',)} + +class AuthorAdmin(admin.ModelAdmin): + list_display = ('name', 'slug', 'death') + search_fields = ('name',) + ordering = ('sort_key', 'name') + + prepopulated_fields = {'slug': ('name',), 'sort_key': ('name',),} + + +admin.site.register(BookStub, BookStubAdmin) +admin.site.register(Author, AuthorAdmin)