mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 21:40:13 +03:00
flake
This commit is contained in:
parent
09aff6daeb
commit
25fee8e07b
|
@ -1295,8 +1295,8 @@ class RecursiveField(Field):
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
field_kwargs = dict(
|
field_kwargs = dict(
|
||||||
(key, value)
|
(key, kwargs[key])
|
||||||
for key in kwargs
|
for key in kwargs
|
||||||
if key in inspect.getargspec(Field.__init__)
|
if key in inspect.getargspec(Field.__init__)
|
||||||
)
|
)
|
||||||
super(RecursiveField, self).__init__(**field_kwargs)
|
super(RecursiveField, self).__init__(**field_kwargs)
|
||||||
|
@ -1305,7 +1305,7 @@ class RecursiveField(Field):
|
||||||
super(RecursiveField, self).bind(field_name, parent)
|
super(RecursiveField, self).bind(field_name, parent)
|
||||||
|
|
||||||
real_dict = object.__getattribute__(self, '__dict__')
|
real_dict = object.__getattribute__(self, '__dict__')
|
||||||
|
|
||||||
if hasattr(parent, 'child') and parent.child is self:
|
if hasattr(parent, 'child') and parent.child is self:
|
||||||
proxy_class = parent.parent.__class__
|
proxy_class = parent.parent.__class__
|
||||||
else:
|
else:
|
||||||
|
@ -1329,6 +1329,7 @@ class RecursiveField(Field):
|
||||||
else:
|
else:
|
||||||
real_dict[name] = value
|
real_dict[name] = value
|
||||||
|
|
||||||
|
|
||||||
class SerializerMethodField(Field):
|
class SerializerMethodField(Field):
|
||||||
"""
|
"""
|
||||||
A read-only field that get its representation from calling a method on the
|
A read-only field that get its representation from calling a method on the
|
||||||
|
|
|
@ -358,6 +358,7 @@ class TestRecursiveField:
|
||||||
assert serializer.validated_data == value, \
|
assert serializer.validated_data == value, \
|
||||||
'deserialized data does not match input'
|
'deserialized data does not match input'
|
||||||
|
|
||||||
|
|
||||||
# Tests for field input and output values.
|
# Tests for field input and output values.
|
||||||
# ----------------------------------------
|
# ----------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user