mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +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
|
Override default so that we can apply ModelSerializer as a nested
|
||||||
field to relationships.
|
field to relationships.
|
||||||
"""
|
"""
|
||||||
|
if self.source == '*':
|
||||||
|
return self.to_native(obj)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if self.source:
|
if self.source:
|
||||||
for component in self.source.split('.'):
|
for component in self.source.split('.'):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user