You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I discovered this problem after upgrading to 3.1, after 86c5fa2 if a QuerySet is passed as iterable data.all() will be called. That's fine until we start to add extra data to the QS and use normal serializers for output.
Case:
objs = Model.objects.filter(x=y)
for obj in objs:
obj.update(extra_dict)
serializer = MySerializer(objs, many=True)
serializer.data will contain only data from QS, ignoring totally the other portion of data added later and ending with a KeyError because we're missing fields that are declared on serializer, this wasn't happening before since data.all() wasn't called while passing QS around.