symposion_app/symposion/conference/admin.py
Hiroshi Miura 55814a57b3 admin: inline edit section
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2015-08-01 13:00:22 +09:00

22 lines
546 B
Python

from django.contrib import admin
from symposion.conference.models import Conference, Section
class SectionInline(admin.TabularInline):
model = Section
prepopulated_fields = {"slug": ("name",)}
extra = 1
class ConferenceAdmin(admin.ModelAdmin):
list_display = ("title", "start_date", "end_date")
inlines = [SectionInline, ]
admin.site.register(Conference, ConferenceAdmin)
admin.site.register(
Section,
prepopulated_fields={"slug": ("name",)},
list_display=("name", "conference", "start_date", "end_date")
)