[Fixed]-Let Django model save() to firebase but not to database

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)
👤Todor

Leave a comment