# HG changeset patch # User cavaliet # Date 1400160519 -7200 # Node ID 7111c4d04cbc018a31fd5d5ebd5f02fdf8989556 # Parent 8fe7e2a5d3361ea554c5b8c37eee6b00e8e0b63f v0.5.8 remove opera command and enhance import opera diff -r 8fe7e2a5d336 -r 7111c4d04cbc src/spel/__init__.py --- a/src/spel/__init__.py Wed May 14 18:26:03 2014 +0200 +++ b/src/spel/__init__.py Thu May 15 15:28:39 2014 +0200 @@ -1,4 +1,4 @@ -VERSION = (0, 5, 7, "final", 0) +VERSION = (0, 5, 8, "final", 0) VERSION_STR = unicode(".".join(map(lambda i:"%02d" % (i,), VERSION[:2]))) diff -r 8fe7e2a5d336 -r 7111c4d04cbc src/spel/management/commands/loadoperadata.py --- a/src/spel/management/commands/loadoperadata.py Wed May 14 18:26:03 2014 +0200 +++ b/src/spel/management/commands/loadoperadata.py Thu May 15 15:28:39 2014 +0200 @@ -138,6 +138,8 @@ # Build tags for k,v in a["content"]["data"].iteritems(): if k!="commentaire" and k!="description" and k!="titre": + if k=="acte" or k=="scene": + v = int(v) k = "opera_" + k v = unicode(v).split(",") for val in v: diff -r 8fe7e2a5d336 -r 7111c4d04cbc src/spel/management/commands/remove_opera.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/spel/management/commands/remove_opera.py Thu May 15 15:28:39 2014 +0200 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +''' +Created on Mar 22, 2013 + +@author: tc +''' + +from django.core.management.base import BaseCommand, CommandError +from ldt.ldt_utils.models import Content +from taggit.models import Tag + + +class Command(BaseCommand): + + def handle(self, *args, **options): + print("Going to remove opera contents, media and projects") + + l = list(Content.objects.filter(tags__name__in=["content_opera"])) + + for c in l: + p = c.front_project + c.front_project = None + p.delete() + c.media_obj.delete() + + print("Going to remove opera tags") + Tag.objects.filter(name__startswith="opera_").delete() + + + # This is the end + print("This is the end") + + \ No newline at end of file diff -r 8fe7e2a5d336 -r 7111c4d04cbc src/spel/static/spel/js/opera.js --- a/src/spel/static/spel/js/opera.js Wed May 14 18:26:03 2014 +0200 +++ b/src/spel/static/spel/js/opera.js Thu May 15 15:28:39 2014 +0200 @@ -44,7 +44,7 @@ var n = data.objects.length; var data2 = []; for(var i=0;i