Merge with 80023516532ff4c9a17f7e513013df8d63cc7a60
authorymh <ymh.work@gmail.com>
Fri, 08 Jul 2011 18:13:54 +0200
changeset 80 15fb85252d88
parent 79 949e319fbaa0 (diff)
parent 77 80023516532f (current diff)
child 81 955f1b6fa9c5
Merge with 80023516532ff4c9a17f7e513013df8d63cc7a60
--- a/web/hdabo/management/commands/import_tag_popularity.py	Fri Jul 08 16:55:54 2011 +0200
+++ b/web/hdabo/management/commands/import_tag_popularity.py	Fri Jul 08 18:13:54 2011 +0200
@@ -10,6 +10,7 @@
 
 from django.core.management.base import BaseCommand, CommandError
 from hdabo.models import Tag
+from hdabo.utils import normalize
 from optparse import make_option
 import csv
 import math
@@ -128,11 +129,10 @@
                                             
                 row = dict([(safe_decode(key, self.encoding), safe_decode(value, self.encoding)) for key, value in row.items()])
                 
-                label = row['label'].strip()
+                label = normalize(row['label'].strip())
                 
                 if not label:
                     continue
-                
-                for tag in Tag.objects.filter(label__iexact=label):
+                for tag in Tag.objects.filter(normalized_label__icontains=label):
                     tag.popularity = int(row['popularity'])
                     tag.save()
--- a/web/hdabo/templates/partial/tag_table.html	Fri Jul 08 16:55:54 2011 +0200
+++ b/web/hdabo/templates/partial/tag_table.html	Fri Jul 08 18:13:54 2011 +0200
@@ -13,7 +13,7 @@
         <th>Catégorie</th>
         {% if ordered_tags %}<th class="large_25 text_centered">Supprimer<br/>le lien W</th>{% endif %}
         <th>Alias</th>
-        {% if ordered_tags %}<th class="large_25 text_centered">Retirer le tag de la liste</th>{% endif %}</tr>
+        {% if ordered_tags %}<th class="large_25 text_centered">Retirer le tag</th>{% endif %}</tr>
     {% if ordered_tags %}
     	{# ordered_tags is a list of TaggedSheet #}
         {% for t in ordered_tags %}