No signals were send by django update method, right? so, how to invalidate the objects when using
model.objects.filter(**kwargs).update(**kwargs)?
I wrote this method to invalidate the objects return by filter method explicitly, will it work?
def nocache_update(qset, **kwargs):
from cacheops import invalidate_obj
for obj in qset.iterator():
try:
invalidate_obj(obj)
except:
pass
# update must behind invalidate obj
n = qset.update(**kwargs)
return n
And call this method as follow:
qset = model.objects.filter(**kwargs)
nocache_update(qset, **kwargs)
No signals were send by django update method, right? so, how to invalidate the objects when using
I wrote this method to invalidate the objects return by filter method explicitly, will it work?
And call this method as follow: