1👍
✅
I don’t think you need to listen for any events here, because you want to completely exclude the database saving functionality. So just move your chatmessage_handler
functionality into your model.save()
method.
Something like this should do the trick.
def save(self, *args, **kwargs):
serializer = ChatMessageSerializer(self)
message_endpoint = ''.join(self.firebase_key)
client.patch(message_endpoint, serializer.data)
Source:stackexchange.com