From: Marek Stępniowski Date: Wed, 3 Sep 2008 21:57:31 +0000 (+0200) Subject: Created FragmentAdmin and registered it with default admin. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/63146acaaff91c50fe73dc650e12a21dcaf832fa?ds=inline Created FragmentAdmin and registered it with default admin. --- diff --git a/catalogue/admin.py b/catalogue/admin.py index 03b72d918..2f5d48ba2 100644 --- a/catalogue/admin.py +++ b/catalogue/admin.py @@ -2,7 +2,7 @@ from django.contrib import admin from newtagging.admin import TaggableModelAdmin -from catalogue.models import Book, Tag +from catalogue.models import Tag, Book, Fragment class TagAdmin(admin.ModelAdmin): @@ -25,6 +25,14 @@ class BookAdmin(TaggableModelAdmin): prepopulated_fields = {'slug': ('title',)} +class FragmentAdmin(TaggableModelAdmin): + tag_model = Tag + + list_display = ('book', 'anchor',) + ordering = ('book', 'anchor',) + + admin.site.register(Tag, TagAdmin) admin.site.register(Book, BookAdmin) +admin.site.register(Fragment, FragmentAdmin)