diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-05-27 20:03:04 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-05-27 20:03:04 (GMT) |
commit | 4a66728a9bbe88704c6e01ec8dd683cdb0a4c0c6 (patch) | |
tree | 9c62c09230aec03187cc13d2ac78d299bd96096b /program/management/commands/importshows.py | |
parent | a1487772e667436e2274dece86cb40d2e58632a7 (diff) | |
parent | c27b374386463c56f41815869d6209f9a422b858 (diff) |
Merge branch 'master' into stable
Diffstat (limited to 'program/management/commands/importshows.py')
-rw-r--r-- | program/management/commands/importshows.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/program/management/commands/importshows.py b/program/management/commands/importshows.py index d5fdee7..f1353b8 100644 --- a/program/management/commands/importshows.py +++ b/program/management/commands/importshows.py @@ -1,7 +1,7 @@ from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.core.management.base import NoArgsCommand from django.template.defaultfilters import slugify -from django.utils.html import clean_html, strip_tags +from django.utils.html import strip_tags import MySQLdb @@ -13,9 +13,10 @@ DB = 'helsinki' TALK = BroadcastFormat.objects.get(pk=1) + class Command(NoArgsCommand): help = 'Import shows from the current program' - + def handle_noargs(self, **options): connection = MySQLdb.connect(user=USER, passwd=PASSWD, db=DB) cursor = connection.cursor() @@ -29,7 +30,7 @@ ORDER BY titel, beginn, ende""") for titel, beschreibung, web, macher in cursor.fetchall(): titel = strip_tags(titel) - beschreibung = clean_html(beschreibung) + beschreibung = strip_tags(beschreibung) slug = slugify(titel) @@ -50,7 +51,8 @@ ORDER BY titel, beginn, ende""") show = Show.objects.get(name=titel) print 'sendung "%s" already imported as show "%s"' % (titel, show) except ObjectDoesNotExist: - show = Show(broadcastformat=TALK, name=titel, slug=slug, short_description='FIXME', description=beschreibung) + show = Show(broadcastformat=TALK, name=titel, slug=slug, short_description='FIXME', + description=beschreibung) try: show.save() counter += 1 |