it/itf/insidepages/admin.py

32 lines
800 B
Python
Raw Permalink Normal View History

2011-08-22 22:04:40 +00:00
from django.contrib import admin
from models import *
# from forms import ArticleForm
class TabsInline(admin.StackedInline):
model = ModuleTab
extra = 4
class ModuleAdmin(admin.ModelAdmin):
inlines = [TabsInline]
prepopulated_fields = {'slug': ('title',)}
2011-09-06 02:57:15 +00:00
save_on_top = True
2011-08-22 22:04:40 +00:00
# list_display = ('name', 'order',)
# list_editable = ['order']
class ButtonsInline(admin.StackedInline):
model = ModelExtra.buttons.through
extra = 3
class SortInline(admin.StackedInline):
model = ModelSort
extra = 4
class ModelExtraAdmin(admin.ModelAdmin):
inlines = [SortInline, ButtonsInline]
2011-08-22 22:04:40 +00:00
admin.site.register(Module, ModuleAdmin)
admin.site.register(ModelExtra, ModelExtraAdmin)
admin.site.register(ModelButton)
2011-08-22 22:04:40 +00:00
#admin.site.register(SliderBox, SliderBoxAdmin)