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
If you set a serializer_field_mapping to for example a fields.CountryField: serializer_fields.CountryField (from django_countries), it will be replaced by a 'dumb' ChoiceField and the serialization will fail. This makes that you have to manually set this field on every serializer and the serializer_field_mapping mechanism won't work.
Another example is the TimeZoneField (if you use the extended version that shows the choices via the OPTIONS request).
The text was updated successfully, but these errors were encountered:
I had to change the custom ChoiceFields (CountryField / TimezoneField) also a little, because they need the argument 'choices' and other arguments (for example 'countries') won't be passed along. Something to keep in mind.
Because of this line:
https://github.com/encode/django-rest-framework/blame/0abb84fa3955956fc6156cc2c51222cd4ceae783/rest_framework/serializers.py#L1286
If you set a serializer_field_mapping to for example a fields.CountryField: serializer_fields.CountryField (from django_countries), it will be replaced by a 'dumb' ChoiceField and the serialization will fail. This makes that you have to manually set this field on every serializer and the serializer_field_mapping mechanism won't work.
Another example is the TimeZoneField (if you use the extended version that shows the choices via the OPTIONS request).
The text was updated successfully, but these errors were encountered: