mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-06-30 02:13:29 +03:00
remove list\tuple changes from PR
This commit is contained in:
parent
e3522e8aef
commit
7d8c95141c
|
@ -992,16 +992,13 @@ class ModelSerializer(Serializer):
|
||||||
if field_name in attrs:
|
if field_name in attrs:
|
||||||
m2m_data[field_name] = attrs.pop(field_name)
|
m2m_data[field_name] = attrs.pop(field_name)
|
||||||
|
|
||||||
def _inner_loop_code(field):
|
# Forward m2m relations
|
||||||
|
for field in meta.many_to_many + meta.virtual_fields:
|
||||||
if isinstance(field, GenericForeignKey):
|
if isinstance(field, GenericForeignKey):
|
||||||
return
|
continue
|
||||||
if field.name in attrs:
|
if field.name in attrs:
|
||||||
m2m_data[field.name] = attrs.pop(field.name)
|
m2m_data[field.name] = attrs.pop(field.name)
|
||||||
|
|
||||||
# Forward m2m relations
|
|
||||||
[_inner_loop_code(field) for field in meta.many_to_many]
|
|
||||||
[_inner_loop_code(field) for field in meta.virtual_fields]
|
|
||||||
|
|
||||||
# Nested forward relations - These need to be marked so we can save
|
# Nested forward relations - These need to be marked so we can save
|
||||||
# them before saving the parent model instance.
|
# them before saving the parent model instance.
|
||||||
for field_name in attrs.keys():
|
for field_name in attrs.keys():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user