Not calling function with source= anymore · Issue #4602 · encode/django-rest-framework (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
Here the serializer:
class IndividuSerializer(ModelSerializer): # ... sexe_display = CharField(source='get_sexe_display', label='sexe', read_only=True)
The API doesn't display the choice values from Django models anymore.
{ "url": "http://localhost:8000/api/dsn/individu/1/", "id": 1, "metadatas": null, "sexe_display": "<bound method curry.._curried of <Individu: XXX XXX>>", "...": "..." }
In the previous release it worked just fine. ;)