Channels don't need to be deleted, they're just pointers. And yes, if you make a channel with the same name as a reply channel, it will function the same - all channels are, are strings put onto messages as a sort of header for routing and queuing purposes.
Andrew On Thu, Jan 19, 2017 at 10:52 AM, Nikoleta Misheva <[email protected]> wrote: > So for example when I need the reply channel in the ws recieve method I > need to create the Channel again and it will be the same channel referring > to the same user? And do I have to delete the newly created channel after > each ws recieve method? > > четвъртък, 19 януари 2017 г., 20:25:41 UTC+2, Andrew Godwin написа: >> >> Hi, >> >> Channel isn't a field type - it's a separate datastructure entirely from >> a database/Django models and is powered by its own code and servers (the >> channel layer). >> >> If you want to persist the name of a reply_channel for use later, like >> knowing what channel connections are on to send information down, then use >> a CharField(max_length=255), and put the name of the channel in that (which >> is usually reply_channel.name). You can then take the string name and >> pass it to channel to make it again like Channel(reply_channel_name). >> >> Hope that helps, >> Andrew >> >> On Thu, Jan 19, 2017 at 6:57 AM, Nikoleta Misheva <[email protected]> >> wrote: >> >>> Hello, sorry to bother you but how do you make a django-channels >>> Channel field in a Django model? I tried to use ForeignKey and >>> ForeignObject but doesn't do the work. >>> Thank you in advance :) >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Django users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at https://groups.google.com/group/django-users. >>> To view this discussion on the web visit https://groups.google.com/d/ms >>> gid/django-users/ace270a5-ccba-43b2-aa54-bc425de9f709%40googlegroups.com >>> <https://groups.google.com/d/msgid/django-users/ace270a5-ccba-43b2-aa54-bc425de9f709%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/django-users/b1626db4-9818-4c77-bc31-48ce5d9a6d0e%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/b1626db4-9818-4c77-bc31-48ce5d9a6d0e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFwN1upcV3ifXhtisp-YYQATabZFeXvkpng03f1j%2BugpPwLZxA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

