mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +03:00
Merge pull request #2857 from w-/patch-3
increase serializer compatibility to django 1.8
This commit is contained in:
commit
9926241afb
|
@ -993,7 +993,11 @@ class ModelSerializer(Serializer):
|
|||
m2m_data[field_name] = attrs.pop(field_name)
|
||||
|
||||
# Forward m2m relations
|
||||
for field in meta.many_to_many + meta.virtual_fields:
|
||||
if issubclass(meta.many_to_many.__class__, tuple):
|
||||
temp_m2m = list(meta.many_to_many)
|
||||
else:
|
||||
temp_m2m = meta.many_to_many
|
||||
for field in temp_m2m + meta.virtual_fields:
|
||||
if isinstance(field, GenericForeignKey):
|
||||
continue
|
||||
if field.name in attrs:
|
||||
|
|
Loading…
Reference in New Issue
Block a user