admin: inline edit section

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
Hiroshi Miura 2015-08-01 12:51:47 +09:00
parent 91ae3de6df
commit 55814a57b3

View file

@ -3,7 +3,18 @@ from django.contrib import admin
from symposion.conference.models import Conference, Section
admin.site.register(Conference, list_display=("title", "start_date", "end_date"))
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",)},