mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +03:00
Serializers should accept source='*' argument. Fixes #604.
(Test also incoming)
This commit is contained in:
parent
a2dcf5e878
commit
b41f258ee5
|
@ -300,6 +300,9 @@ class BaseSerializer(Field):
|
|||
Override default so that we can apply ModelSerializer as a nested
|
||||
field to relationships.
|
||||
"""
|
||||
if self.source == '*':
|
||||
return self.to_native(obj)
|
||||
|
||||
try:
|
||||
if self.source:
|
||||
for component in self.source.split('.'):
|
||||
|
|
Loading…
Reference in New Issue
Block a user