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',)}
18 class AuthorAdmin(admin.ModelAdmin):
19 list_display = ('name', 'slug', 'death')
20 search_fields = ('name',)
21 ordering = ('sort_key', 'name')
23 prepopulated_fields = {'slug': ('name',), 'sort_key': ('name',)}
26 admin.site.register(BookStub, BookStubAdmin)
27 admin.site.register(Author, AuthorAdmin)