]> git.parisson.com Git - telecaster-client.git/commitdiff
add station cleanup script
authoryomguy <yomguy@parisson.com>
Wed, 10 Apr 2013 16:37:07 +0000 (18:37 +0200)
committeryomguy <yomguy@parisson.com>
Wed, 10 Apr 2013 16:37:07 +0000 (18:37 +0200)
telecaster/management/commands/telecaster-station-cleanup.py [new file with mode: 0644]

diff --git a/telecaster/management/commands/telecaster-station-cleanup.py b/telecaster/management/commands/telecaster-station-cleanup.py
new file mode 100644 (file)
index 0000000..7f6abc0
--- /dev/null
@@ -0,0 +1,22 @@
+from optparse import make_option
+from django.conf import settings
+from django.core.management.base import BaseCommand, CommandError
+from django.contrib.auth.models import User
+from django.template.defaultfilters import slugify
+from telemeta.models import *
+from telemeta.util.unaccent import unaccent
+from teleforma.models import *
+from telecaster.models import *
+from telecaster.tools import *
+import os
+
+class Command(BaseCommand):
+    help = "Make all station.started=False"
+    admin_email = 'webmaster@parisson.com'
+
+    def handle(self, *args, **options):
+        stations = Station.objects.filter(started=True)
+        for station in stations:
+            station.started = False
+            station.save()
+