You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got empty field if I use form-data input when apply NestedField. It seems NestedField only support JSON input. I add some log into DRF native serializers.py's to_internal_value() and I got below log with different format input
print('data: {}'.format(data))
for field in fields:
validate_method = getattr(self, 'validate_' + field.field_name, None)
print('field: {}'.format(field))
primitive_value = field.get_value(data)
print('key: {}, value: {}'.format(field.field_name, primitive_value))
I got empty field if I use form-data input when apply NestedField. It seems NestedField only support JSON input. I add some log into DRF native serializers.py's to_internal_value() and I got below log with different format input
data: <QueryDict: {'name': ['player04'], 'merchant': ['1']}>
field: NestedField(MerchantSerializer, many=False)
key: merchant, value: <class 'rest_framework.fields.empty'>
data: {'merchant': 1, 'name': 'PlayerJson01'}
field: NestedField(MerchantSerializer, many=False)
key: merchant, value: 1
Hope NestedField can support form-data as well, Thank you very much
The text was updated successfully, but these errors were encountered: