1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 from django.contrib import admin
6 from pdcounter.models import BookStub, Author
9 class BookStubAdmin(admin.ModelAdmin):
10 list_display = ('title', 'author', 'slug', 'pd')
11 search_fields = ('title', 'author')
14 prepopulated_fields = {'slug': ('title',)}
17 class AuthorAdmin(admin.ModelAdmin):
18 list_display = ('name', 'slug', 'death')
19 search_fields = ('name',)
20 ordering = ('sort_key', 'name')
22 prepopulated_fields = {'slug': ('name',), 'sort_key': ('name',)}
25 admin.site.register(BookStub, BookStubAdmin)
26 admin.site.register(Author, AuthorAdmin)