summaryrefslogtreecommitdiff
path: root/program/management
diff options
context:
space:
mode:
authorErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2012-02-17 17:46:00 (GMT)
committerErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2012-02-17 17:46:00 (GMT)
commit80ddae9c01fd8cda748c8017e942a4e48ec9975b (patch)
treef4c9574bcff6ce4bfbe23692a7a4b57213d34c90 /program/management
parenteaaa0abdfe9ab3296c7a2c9c90bc2f1375655940 (diff)
added status as argument.
Diffstat (limited to 'program/management')
-rw-r--r--program/management/commands/addnote.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/program/management/commands/addnote.py b/program/management/commands/addnote.py
index f406224..e232bff 100644
--- a/program/management/commands/addnote.py
+++ b/program/management/commands/addnote.py
@@ -9,12 +9,13 @@ from program.models import Show, TimeSlot, Note
class Command(BaseCommand):
help = 'adds a note to a timeslot'
- args = '<show_id> <date>'
-
+ args = '<show_id> <date> <status>'
+
def handle(self, *args, **options):
- if len(args) == 2:
+ if len(args) == 3:
show_id = args[0]
start_date = args[1]
+ status = args[2]
else:
raise CommandError('you must provide the show_id date')
@@ -42,7 +43,7 @@ class Command(BaseCommand):
raise CommandError(e)
owner = show.owners.all()[0] if show.owners.count() > 0 else User.objects.get(pk=1)
- note = Note(timeslot=timeslot, owner=owner, title=title, content=''.join(lines))
+ note = Note(timeslot=timeslot, owner=owner, title=title, content=''.join(lines), status=status)
try:
note.validate_unique()