From 75e0ccf888f21e11baee743a52641f235bbf24e0 Mon Sep 17 00:00:00 2001 From: Ernesto Rico-Schmidt Date: Tue, 7 Jan 2014 14:39:29 +0100 Subject: fixed addnote command when index is needed (multiple timeslots per show and day) diff --git a/program/management/commands/addnote.py b/program/management/commands/addnote.py index f418e6e..01d891e 100644 --- a/program/management/commands/addnote.py +++ b/program/management/commands/addnote.py @@ -17,6 +17,9 @@ class Command(BaseCommand): start_date = args[1] status = args[2] elif len(args) == 4: + show_id = args[0] + start_date = args[1] + status = args[2] index = args[3] else: raise CommandError('you must provide the show_id, start_date, status [index]') @@ -41,7 +44,7 @@ class Command(BaseCommand): if not index: raise CommandError('you must provide the show_id, start_date, status index') try: - timeslot = TimeSlot.objects.filter(show=show, start__year=year, start__month=month, start__day=day).order_by('start')[index] + timeslot = TimeSlot.objects.filter(show=show, start__year=year, start__month=month, start__day=day).order_by('start')[int(index)] except IndexError as ie: raise CommandError(ie) -- cgit v0.10.2