From: Guillaume Pellerin Date: Sat, 1 Feb 2014 23:50:41 +0000 (+0100) Subject: add conference delete command X-Git-Tag: 1.1~494 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=4310aa5d95d0b174320c2781da8fa9ee7743721a;p=teleforma.git add conference delete command --- diff --git a/teleforma/management/commands/teleforma-delete-period-conferences.py b/teleforma/management/commands/teleforma-delete-period-conferences.py new file mode 100644 index 00000000..82e9e963 --- /dev/null +++ b/teleforma/management/commands/teleforma-delete-period-conferences.py @@ -0,0 +1,23 @@ +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 * + + +class Command(BaseCommand): + help = "Delete all conferences fir a given period" + args = "period_name" + admin_email = 'webmaster@parisson.com' + + def handle(self, *args, **options): + period_name = args[0] + period = Period.objects.get(name=period_name) + conferences = Conference.objects.filter(period=period) + for conference in conferences: + print conference.public_id + conference.delete() + \ No newline at end of file