Given an individual model instance, determine which backends the update should be sent to & update the object on those backends.
(self, sender, instance, **kwargs)
| 37 | pass |
| 38 | |
| 39 | def handle_save(self, sender, instance, **kwargs): |
| 40 | """ |
| 41 | Given an individual model instance, determine which backends the |
| 42 | update should be sent to & update the object on those backends. |
| 43 | """ |
| 44 | using_backends = self.connection_router.for_write(instance=instance) |
| 45 | |
| 46 | for using in using_backends: |
| 47 | try: |
| 48 | index = self.connections[using].get_unified_index().get_index(sender) |
| 49 | index.update_object(instance, using=using) |
| 50 | except NotHandled: |
| 51 | # TODO: Maybe log it or let the exception bubble? |
| 52 | pass |
| 53 | |
| 54 | def handle_delete(self, sender, instance, **kwargs): |
| 55 | """ |
nothing calls this directly
no test coverage detected