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]
|
2011-08-27 10:54:45 +00:00
|
|
|
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']
|
|
|
|
|
2011-08-27 10:54:45 +00:00
|
|
|
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)
|
2011-08-27 10:54:45 +00:00
|
|
|
admin.site.register(ModelExtra, ModelExtraAdmin)
|
|
|
|
admin.site.register(ModelButton)
|
2011-08-22 22:04:40 +00:00
|
|
|
#admin.site.register(SliderBox, SliderBoxAdmin)
|
|
|
|
|