Importing catalogue from pdcounter dump.
[redakcja.git] / src / catalogue / admin.py
1 from django.contrib import admin
2 from . import models
3 from .wikidata import WikidataAdminMixin
4
5
6 class AuthorAdmin(WikidataAdminMixin, admin.ModelAdmin):
7     list_display = "first_name", "last_name", "notes"
8     search_fields = ["first_name", "last_name", "wikidata"]
9     prepopulated_fields = {"slug": ("first_name", "last_name")}
10
11
12 admin.site.register(models.Author, AuthorAdmin)
13
14
15 class BookAdmin(WikidataAdminMixin, admin.ModelAdmin):
16     list_display = "title", "notes"
17     autocomplete_fields = ["authors", "translators"]
18     prepopulated_fields = {"slug": ("title",)}
19
20
21 admin.site.register(models.Book, BookAdmin)