From 6cfb3cbfb3a36f1ab0b2955bbce81c89a6d117cc Mon Sep 17 00:00:00 2001 From: yomguy Date: Wed, 10 Apr 2013 18:37:07 +0200 Subject: [PATCH] add station cleanup script --- .../commands/telecaster-station-cleanup.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 telecaster/management/commands/telecaster-station-cleanup.py diff --git a/telecaster/management/commands/telecaster-station-cleanup.py b/telecaster/management/commands/telecaster-station-cleanup.py new file mode 100644 index 0000000..7f6abc0 --- /dev/null +++ b/telecaster/management/commands/telecaster-station-cleanup.py @@ -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() + -- 2.39.5