[Fixed]-Django-REST-Framework – create element with list of elements

1👍

You need to override create method if you want to create the B objects as well.

From the documentation of Writable Nested Serializers:

By default nested serializers are read-only. If you want to support write-operations to a nested serializer field you’ll need to create create() and/or update() methods in order to explicitly specify how the child relationships should be saved.

👤AKS

0👍

You probably don’t need the many=True kwarg if you already use ListField.
But you should be looking at the solution provided by AKS.

👤Theof

Leave a comment