You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hello,
In another question it was pointed out that data binding has been removed form the channels 2.x core. Andrew said "You can write most of the data binding functionality yourself in Channels 2 by adding group send methods to model save methods" - can anyone provide a basic example of how to properly import and use the consumer to send communication this way (I presume that the model save method would be overloaded in the models.py and the consumer would be imported and called there)?
Thanks in advance
Mikhailo Keda
unread,
Aug 22, 2018, 3:12:58 PM8/22/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
середа, 22 серпня 2018 р. 22:12:58 UTC+3 користувач Mikhailo Keda написав:
weezar...@gmail.com
unread,
Aug 22, 2018, 3:30:44 PM8/22/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Thank you very much! This will be extremely helpful in accomplishing my intended usage!
weezar...@gmail.com
unread,
Aug 22, 2018, 3:45:15 PM8/22/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Another thought occurs to me: what are the benefits (if any) of this method vs. hooking into the save / create / delete signals?
weezar...@gmail.com
unread,
Aug 22, 2018, 4:31:38 PM8/22/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Also, if for instance I am updating a user model with information that I want only that specific user to see, how do I send over the websocket to only that user (they would have an authenticated session)?
sorry for the bombardment of questions :P
Mikhailo Keda
unread,
Aug 23, 2018, 1:51:30 AM8/23/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
There are no benefits. As for me if you need to implement data binding just for one model - you could do this directly in the model, if you need data binding for few models - better to use signals to keep code clean and readable.