Answer the question
In order to leave comments, you need to log in
Is it possible to update a list using Django Channels?
There is a Project model with a members field. The list of participants with their roles in the project is displayed on a separate page. I wanted to add asynchrony to the project using Django Сhannels. When adding participants to the project, the list would be updated with new participants without reloading. Is this possible with Django channels?
models.py :
class Project(models.Model):
members = models.ManyToManyField(User, through='Member', help_text=_('Members'))
class Member(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
project = models.ForeignKey(Project, on_delete=models.CASCADE)
role = models.CharField(max_length=20, choices=ROLE_CHOICES
) {% for member in project.member_set.all %}
{{ member.user }}
{{ member.role }}
{% endfor %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question