# HG changeset patch # User ymh # Date 1310152930 -7200 # Node ID 955f1b6fa9c57213320d37f50b81f99246d3b82f # Parent 15fb85252d88710c9878ad4bc14b89f91e50e8a2 correct popularity import. close bug #17 diff -r 15fb85252d88 -r 955f1b6fa9c5 web/hdabo/fixtures/datasheet_10.yaml.bz2 Binary file web/hdabo/fixtures/datasheet_10.yaml.bz2 has changed diff -r 15fb85252d88 -r 955f1b6fa9c5 web/hdabo/fixtures/datasheet_347.yaml.bz2 Binary file web/hdabo/fixtures/datasheet_347.yaml.bz2 has changed diff -r 15fb85252d88 -r 955f1b6fa9c5 web/hdabo/fixtures/datasheet_all.yaml.bz2 Binary file web/hdabo/fixtures/datasheet_all.yaml.bz2 has changed diff -r 15fb85252d88 -r 955f1b6fa9c5 web/hdabo/management/commands/import_tag_popularity.py --- a/web/hdabo/management/commands/import_tag_popularity.py Fri Jul 08 18:13:54 2011 +0200 +++ b/web/hdabo/management/commands/import_tag_popularity.py Fri Jul 08 21:22:10 2011 +0200 @@ -130,8 +130,9 @@ row = dict([(safe_decode(key, self.encoding), safe_decode(value, self.encoding)) for key, value in row.items()]) label = normalize(row['label'].strip()) + popularity_str = row['popularity'] - if not label: + if not label or not popularity_str: continue for tag in Tag.objects.filter(normalized_label__icontains=label): tag.popularity = int(row['popularity'])