From 63146acaaff91c50fe73dc650e12a21dcaf832fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Wed, 3 Sep 2008 23:57:31 +0200 Subject: [PATCH] Created FragmentAdmin and registered it with default admin. --- catalogue/admin.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) -- 2.20.1