﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26766	Delayed effect of calling set on ManyToManyField	jeberger	nobody	"When calling `set` on a `ManyToManyField`, the effect is not visible in the current object, but is only visible after the object has been re-fetched from the DB:

{{{#!python
my_model = MyModel.objects.get (id = 1)

my_model.some_m2m_field.set (some_list)
my_model.save()    # Not really necessary according to the docs

# These two lines should print the same thing, but the second one
# prints an empty list
print some_list
print my_model.some_m2m_field.all()

my_model = MyModel.objects.get (id = 1)
# Now the list is correct
print my_model.some_m2m_field.all()
}}}"	Bug	closed	Database layer (models, ORM)	1.9	Normal	worksforme			Unreviewed	0	0	0	0	0	0
