mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Support callable attributes in dotted source. Closes #2142.
This commit is contained in:
parent
2647e1aaaa
commit
1ffe4857ec
|
@ -68,8 +68,8 @@ def get_attribute(instance, attrs):
|
|||
return instance[attr]
|
||||
except (KeyError, TypeError, AttributeError):
|
||||
raise exc
|
||||
if is_simple_callable(instance):
|
||||
return instance()
|
||||
if is_simple_callable(instance):
|
||||
return instance()
|
||||
return instance
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user