fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added fragment_short.html to repository.
[wolnelektury.git]
/
catalogue
/
admin.py
diff --git
a/catalogue/admin.py
b/catalogue/admin.py
index
2afc794
..
2f5d48b
100644
(file)
--- a/
catalogue/admin.py
+++ b/
catalogue/admin.py
@@
-1,11
+1,8
@@
# -*- coding: utf-8 -*-
from django.contrib import admin
# -*- coding: utf-8 -*-
from django.contrib import admin
-from django import forms
-from django.utils.safestring import mark_safe
-from django.utils.translation import ugettext_lazy as _
from newtagging.admin import TaggableModelAdmin
from newtagging.admin import TaggableModelAdmin
-from catalogue.models import
Book, Tag
+from catalogue.models import
Tag, Book, Fragment
class TagAdmin(admin.ModelAdmin):
class TagAdmin(admin.ModelAdmin):
@@
-17,8
+14,6
@@
class TagAdmin(admin.ModelAdmin):
prepopulated_fields = {'slug': ('name',), 'sort_key': ('name',),}
radio_fields = {'category': admin.HORIZONTAL}
prepopulated_fields = {'slug': ('name',), 'sort_key': ('name',),}
radio_fields = {'category': admin.HORIZONTAL}
-admin.site.register(Tag, TagAdmin)
-
class BookAdmin(TaggableModelAdmin):
tag_model = Tag
class BookAdmin(TaggableModelAdmin):
tag_model = Tag
@@
-29,5
+24,15
@@
class BookAdmin(TaggableModelAdmin):
prepopulated_fields = {'slug': ('title',)}
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(Book, BookAdmin)
+admin.site.register(Fragment, FragmentAdmin)