The Python Oracle

How can i bulk create in django rest serializer

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Quirky Dreamscape Looping

--

Chapters
00:00 How Can I Bulk Create In Django Rest Serializer
00:49 Accepted Answer Score 11
01:17 Thank you

--

Full question
https://stackoverflow.com/questions/3382...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #django #djangorestframework

#avk47



ACCEPTED ANSWER

Score 11


Yes you do need to override create and update methods of your UserSerializer.

I've spent a lot of time trying to make nested writable serializers work with DRF 2.x and the more I fixed issues the more issues were risen with corner use cases.

Therefore Tom decided that it should be left up to the developer to handle the creation and updates.

The documentation provides an example for a 1 nesting level creation but it's the same for update and/or with more nesting level