- this is consumers.py

class ChatConsumer(AsyncWebsocketConsumer): 
                       async def receive(self, text_data):
                                          pass 
   
   - this is my view.py

class CreateChatMessageView(APIView): ...
                           message_obj = 
ChatMessage.objects.create(chat_room=chat_room_obj,                        
     sender_id=sender_id, receiver_id=receiver_id, 
message_text=message_text, message_attachment=message_attachment) 
                               # here I want to call the 'receive' function 
from 'ChatConsumer(AsyncWebsocketConsumer):' 
                               message_obj.save() ... 
   
   - I want to call the receive function 
   from ChatConsumer(AsyncWebsocketConsumer):.
   - How can I have done?

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/ed0b3d3c-c878-4a7d-9a69-8234feb57c67n%40googlegroups.com.

Reply via email to