... | ... | @@ -470,7 +470,7 @@ print(json.dumps(seria.data), indent=2) |
|
|
|
|
|
[Official DRF documentation of serializer fields](https://www.django-rest-framework.org/api-guide/fields/)
|
|
|
|
|
|
If the default serializer field used for a field is not the one want, or if the behaviour need to be changed or even if there is no default serializer field, a custom serializer field can be used. Example:
|
|
|
If the default serializer field used for a field is not the one wanted, or if the behaviour needs to be changed or even if there is no default serializer field, a custom serializer field can be used. Example:
|
|
|
|
|
|
```python
|
|
|
import json
|
... | ... | |