]> git.0d.be Git - django-panik-emissions.git/commitdiff
adapt args handling to newer django
authorFrédéric Péters <fpeters@0d.be>
Sun, 16 Jul 2017 11:18:14 +0000 (13:18 +0200)
committerFrédéric Péters <fpeters@0d.be>
Thu, 10 Aug 2017 13:44:57 +0000 (15:44 +0200)
emissions/management/commands/day-program.py

index 49bb676822cfe81be435126fbf452ae663aa5564..2a9256366e975b2423bc357ef032713649d150f1 100644 (file)
@@ -6,7 +6,11 @@ from ...utils import day_program
 
 
 class Command(BaseCommand):
-    def handle(self, year, month, day, **options):
+    def add_arguments(self, parser):
+        parser.add_argument('date', metavar='DATE', type=str)
+
+    def handle(self, date, **options):
+        year, month, day = date.split('-')
         date = datetime(int(year), int(month), int(day))
         for entry in day_program(date):
             print entry.datetime, entry