... | ... | @@ -509,7 +509,7 @@ print(json.dumps(seria.data), indent=2) |
|
|
|
|
|
## 6.5 - Add custom serializer fields
|
|
|
|
|
|
This custom addition of serializer field can also be used to add fields that do not correspond to a field in the model or to rename fields. Note that new serializer fields need to be explicitely include in the `fields` attribute. Example:
|
|
|
This custom addition of serializer field can also be used to add fields that do not correspond to a field in the model or to rename fields. Note that new serializer fields need to be explicitely included in the `fields` attribute. Example:
|
|
|
|
|
|
```python
|
|
|
import json
|
... | ... | |