In views.py
I have:
my_computer = Computer.objects.get(pk=some_value)
The computer object has a field called projects that's a ManyRelatedManager
.
Calling
my_projects = my_computer.projects.all()
will set the value of my_projects
to a list of three project objects.
What I'm trying to achive is to set the value of my_computer.projects
to the above list of projects instead of the ManyRelatedManager
.
I have tried:
my_computer.projects = my_projects
but that doesn't work, although it doesn't raise an error either. The value of my_computer.projects
is still the ManyRelatedManager
.