summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2016-06-12 16:19:35 (GMT)
committerErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2016-06-12 16:19:35 (GMT)
commitb18d1c7c5ad1f8e2c68c970a88b2be15124ed8d0 (patch)
tree3efc8f51c29d1bfce303f944634ddb29911b315f /program
parentc87f9a6cec9a855972c8cdd0841e444bf2cfbef2 (diff)
show only name in the admin program slots.
Diffstat (limited to 'program')
-rw-r--r--program/admin.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/program/admin.py b/program/admin.py
index 91ac63d..cffb65e 100644
--- a/program/admin.py
+++ b/program/admin.py
@@ -65,7 +65,7 @@ class ProgramSlotAdmin(admin.ModelAdmin):
actions = ('renew',)
inlines = (TimeSlotInline,)
fields = (('rrule', 'byweekday'), ('dstart', 'tstart', 'tend'), 'until', 'is_repetition', 'automation_id')
- list_display = ('show', 'byweekday', 'rrule', 'tstart', 'tend', 'until')
+ list_display = ('get_show_name', 'byweekday', 'rrule', 'tstart', 'tend', 'until')
list_filter = ('byweekday', 'rrule', 'is_repetition', 'is_active')
ordering = ('byweekday', 'dstart')
save_on_top = True
@@ -82,6 +82,10 @@ class ProgramSlotAdmin(admin.ModelAdmin):
self.message_user(request, message)
renew.short_description = _("Renew selected program slots")
+ def get_show_name(self, obj):
+ return obj.show.name
+ get_show_name.admin_order_field = 'show'
+
class ProgramSlotInline(admin.TabularInline):
model = ProgramSlot