MCPcopy Create free account
hub / github.com/django-haystack/django-haystack / update_object

Method update_object

haystack/indexes.py:310–324  ·  view source on GitHub ↗

Update the index for a single object. Attached to the class's post-save hook. If ``using`` is provided, it specifies which connection should be used. Default relies on the routers to decide which backend should be used.

(self, instance, using=None, **kwargs)

Source from the content-addressed store, hash-verified

308 backend.update(self, self.index_queryset(using=using))
309
310 def update_object(self, instance, using=None, **kwargs):
311 """
312 Update the index for a single object. Attached to the class's
313 post-save hook.
314
315 If ``using`` is provided, it specifies which connection should be
316 used. Default relies on the routers to decide which backend should
317 be used.
318 """
319 # Check to make sure we want to index this first.
320 if self.should_update(instance, **kwargs):
321 backend = self.get_backend(using)
322
323 if backend is not None:
324 backend.update(self, [instance])
325
326 def remove_object(self, instance, using=None, **kwargs):
327 """

Callers 1

handle_saveMethod · 0.45

Calls 3

should_updateMethod · 0.95
get_backendMethod · 0.95
updateMethod · 0.45

Tested by

no test coverage detected