Correction bug #20. The solution is mainly to make sure that the index is recalculated - small optimization
authorymh <ymh.work@gmail.com>
Mon, 11 Jul 2011 17:20:30 +0200
changeset 84 84dc6383323d
parent 83 1c4729b3dac1
child 85 2ff78b3ac007
Correction bug #20. The solution is mainly to make sure that the index is recalculated - small optimization
web/hdabo/wp_utils.py
--- a/web/hdabo/wp_utils.py	Mon Jul 11 17:03:23 2011 +0200
+++ b/web/hdabo/wp_utils.py	Mon Jul 11 17:20:30 2011 +0200
@@ -178,11 +178,8 @@
         results = SearchQuerySet().filter(title=ts.tag.label).filter_or(description=ts.tag.label).filter(**kwargs)
         if len(results) > 0:
             ts.index_note += results[0].score
-#        results = SearchQuerySet().filter(description=ts.tag.label).filter(**kwargs)
-#        if len(results) > 0:
-#            ts.index_note += results[0].score
+            ts.save()
 
-        ts.save()
         ts_list.append(ts)
     ts_list.sort(key=lambda t: (-t.index_note, t.order))
     for k, ts in enumerate(ts_list):