it/itf/bestpractices/admin.py

32 lines
925 B
Python
Raw Normal View History

2010-12-06 22:33:00 +00:00
from django.contrib import admin
from models import *
2011-11-08 03:57:09 +00:00
from markitup.widgets import MarkItUpWidget
2010-12-06 22:33:00 +00:00
2010-12-07 14:51:24 +00:00
class ImageInline(admin.StackedInline):
model = BestPracticeImage
extra = 2
2011-03-06 12:42:33 +00:00
class StoryInline(admin.StackedInline):
formfield_overrides = {models.TextField: {'widget': MarkItUpWidget}}
2011-03-06 12:42:33 +00:00
model = BestPracticeStory
extra = 3
2010-12-07 14:51:24 +00:00
class LinkInline(admin.StackedInline):
model = BestPracticeLink
extra = 3
class BestPracticeAdmin(admin.ModelAdmin):
2011-03-06 12:42:33 +00:00
inlines = [ImageInline, LinkInline, StoryInline]
2010-12-07 14:51:24 +00:00
list_filter = ['category']
2011-11-08 03:57:09 +00:00
formfield_overrides = {models.TextField: {'widget': MarkItUpWidget}}
2010-12-07 14:51:24 +00:00
admin.site.register(BestPractice, BestPracticeAdmin)
admin.site.register(BestPracticeCategory)
admin.site.register(BestPracticeImage)
admin.site.register(BestPracticeLink)
2011-01-19 10:10:29 +00:00
admin.site.register(Guideline)
admin.site.register(Glossary)
2011-04-18 13:44:00 +00:00
admin.site.register(BestPracticeDownload)
2011-04-25 19:13:19 +00:00
admin.site.register(BestPracticeFAQ)