fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes.
[redakcja.git]
/
src
/
catalogue
/
admin.py
diff --git
a/src/catalogue/admin.py
b/src/catalogue/admin.py
index
189cd71
..
bd783b9
100644
(file)
--- a/
src/catalogue/admin.py
+++ b/
src/catalogue/admin.py
@@
-1,17
+1,21
@@
from django.contrib import admin
from . import models
from django.contrib import admin
from . import models
+from .wikidata import WikidataAdminMixin
+class AuthorAdmin(WikidataAdminMixin, admin.ModelAdmin):
+ list_display = "first_name", "last_name", "notes"
+ search_fields = ["first_name", "last_name", "wikidata"]
+ prepopulated_fields = {"slug": ("first_name", "last_name")}
-class AuthorAdmin(admin.ModelAdmin):
- search_fields = ['name']
admin.site.register(models.Author, AuthorAdmin)
admin.site.register(models.Author, AuthorAdmin)
-class BookAdmin(admin.ModelAdmin):
- raw_id_fields = ['authors']
- autocomplete_fields = ['translators']
+class BookAdmin(WikidataAdminMixin, admin.ModelAdmin):
+ list_display = "title", "notes"
+ autocomplete_fields = ["authors", "translators"]
+ prepopulated_fields = {"slug": ("title",)}
-admin.site.register(models.Book, BookAdmin)
+admin.site.register(models.Book, BookAdmin)