Commit 17aab089 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

bugfix: reset proximity cache after add and delete

parent 306d598f1a1c
......@@ -48,15 +48,15 @@ def reset_proximity_cache():
global ADS_PROXIMITY, VECTORS
ADS_PROXIMITY = {}
VECTORS = {}
print 'emptying proximity cache *****************'
#print 'emptying proximity cache *****************'
def update_proximity_cache(_cw):
if not VECTORS:
VECTORS.update(get_vectors(_cw))
print 'computing vectors ****************'
#print 'computing vectors ****************'
if not ADS_PROXIMITY:
ADS_PROXIMITY.update(get_ads_proximity(VECTORS))
print 'computing proximity ****************'
#print 'computing proximity ****************'
class ClassifiedAd(AnyEntity):
__regid__ = 'ClassifiedAd'
......
......@@ -4,7 +4,7 @@ from cubicweb.selectors import implements
class ClassifiedAdAttributeHook(Hook):
__regid__ = 'classifiedad_attribute_hook'
events = ('after_update_entity',)
events = ('after_add_entity', 'after_update_entity', 'after_delete_entity')
__select__ = Hook.__select__ & implements('ClassifiedAd')
def __call__(self):
......
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# cubicweb-classifiedad i18n/en.po
# Copyright (C) 2010 Nicolas Chauvat - Logilab
# Nicolas Chauvat <nicolas.chauvat@logilab.fr>, 2010.
#
#, fuzzy
msgid ""
......@@ -14,14 +14,6 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#~ msgid ""
#~ msgstr ""
#~ "MIME-Version: 1.0\n"
#~ "Content-Type: text/plain; charset=UTF-8\n"
#~ "Content-Transfer-Encoding: 8bit\n"
#~ "Generated-By: pygettext.py 1.5\n"
#~ "Plural-Forms: nplurals=2; plural=(n > 1);\n"
# #-#-#-#-# schema.pot (cubicweb 3.7.3) #-#-#-#-#
# schema pot file, generated on 2010-04-11 19:15:16
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment