fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4abdab4
)
Created FragmentAdmin and registered it with default admin.
author
Marek Stępniowski
<marek@stepniowski.com>
Wed, 3 Sep 2008 21:57:31 +0000
(23:57 +0200)
committer
Marek Stępniowski
<marek@stepniowski.com>
Wed, 3 Sep 2008 21:57:31 +0000
(23:57 +0200)
catalogue/admin.py
patch
|
blob
|
history
diff --git
a/catalogue/admin.py
b/catalogue/admin.py
index
03b72d9
..
2f5d48b
100644
(file)
--- a/
catalogue/admin.py
+++ b/
catalogue/admin.py
@@
-2,7
+2,7
@@
from django.contrib import admin
from newtagging.admin import TaggableModelAdmin
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):
class TagAdmin(admin.ModelAdmin):
@@
-25,6
+25,14
@@
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(Tag, TagAdmin)
admin.site.register(Book, BookAdmin)
+admin.site.register(Fragment, FragmentAdmin)