fix an error for model inheritance in _filter_values
@@ -459,7 +459,8 @@ class BaseQueryWrapper(BaseWrapper):
for pk, new_value in other_values:
(add_pks if check(new_value) else remove_pks).append(pk)
created_pks = set()
- for pk, values in chain(*(self._changeset.created_objects.get(model, {}).items() for model in submodels)):
+ for model in submodels:
+ for pk, values in self._changeset.created_objects.get(model, {}).items():
field_name = getattr(model._meta.get_field(field_name), 'attname', field_name)
if check(getattr(self._changeset.get_created_object(self._obj.model, pk), field_name)):
created_pks.add(pk)
