From: yomguy Date: Wed, 10 Apr 2013 16:37:07 +0000 (+0200) Subject: add station cleanup script X-Git-Tag: 0.9~29^2~1 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=6cfb3cbfb3a36f1ab0b2955bbce81c89a6d117cc;p=telecaster-client.git add station cleanup script --- 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() +