1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
5 from django.contrib import admin
7 from pdcounter.models import BookStub, Author
10 class BookStubAdmin(admin.ModelAdmin):
11 list_display = ('title', 'author', 'slug', 'pd')
12 search_fields = ('title', 'author')
15 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)