--- 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 %}