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

Method handle_delete

haystack/signals.py:54–67  ·  view source on GitHub ↗

Given an individual model instance, determine which backends the delete should be sent to & delete the object on those backends.

(self, sender, instance, **kwargs)

Source from the content-addressed store, hash-verified

52 pass
53
54 def handle_delete(self, sender, instance, **kwargs):
55 """
56 Given an individual model instance, determine which backends the
57 delete should be sent to & delete the object on those backends.
58 """
59 using_backends = self.connection_router.for_write(instance=instance)
60
61 for using in using_backends:
62 try:
63 index = self.connections[using].get_unified_index().get_index(sender)
64 index.remove_object(instance, using=using)
65 except NotHandled:
66 # TODO: Maybe log it or let the exception bubble?
67 pass
68
69
70class RealtimeSignalProcessor(BaseSignalProcessor):

Callers

nothing calls this directly

Calls 4

get_unified_indexMethod · 0.80
for_writeMethod · 0.45
get_indexMethod · 0.45
remove_objectMethod · 0.45

Tested by

no test coverage detected