diff options
author | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2011-12-29 16:07:46 (GMT) |
---|---|---|
committer | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2011-12-29 16:07:46 (GMT) |
commit | 92fc8037e32dae0e17e25a92a79c992645b27b3a (patch) | |
tree | f5550e1ebec8f5a7b28467af6845d53826dc4c01 | |
parent | dbe965a97a360f9117d5d9ee429fd5229102f2a5 (diff) |
undo read only fields in inline admins
-rw-r--r-- | program/admin.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/program/admin.py b/program/admin.py index cec7857..31b84bc 100644 --- a/program/admin.py +++ b/program/admin.py @@ -44,10 +44,8 @@ class NoteAdmin(admin.ModelAdmin): obj.save() class TimeSlotInline(admin.TabularInline): - extra = 0 - max_num = 1 + max_num = 2 model = TimeSlot - readonly_fields = ('start', 'end') def renew(modeladmin, request, queryset): next_year = date.today().year+1 @@ -57,17 +55,15 @@ renew.short_description = _("Renew selected time slots") class ProgramSlotAdmin(admin.ModelAdmin): actions = (renew,) inlines = (TimeSlotInline,) - list_display = ('show', 'byweekday', 'rrule', 'tstart', 'tend', 'dstart', 'until', 'timeslot_count') + list_display = ('show', 'byweekday', 'rrule', 'tstart', 'tend', 'until', 'timeslot_count') list_filter = ('byweekday', 'rrule', 'is_repetition') ordering = ('byweekday', 'dstart') save_on_top = True search_fields = ('show__name',) class ProgramSlotInline(admin.TabularInline): - extra = 0 - max_num = 1 + max_num = 2 model = ProgramSlot - readonly_fields = ('rrule', 'byweekday', 'dstart', 'tstart', 'tend', 'is_repetition') class ShowAdmin(admin.ModelAdmin): filter_horizontal = ('hosts', 'owners', 'musicfocus', 'showinformation', 'showtopic') |