0

What is the right™ way to design DRF serializers that receive the following POSTed data to a List model:

{
    list_name: "friends",
    contacts: ["alice", "bob"]
}

And handles the creation of the nested Contact objects? Additionally, assume an extra step is needed to convert the names to capitalized (['Alice', 'Bob']).

1 Answer 1

1

You could use django-rest-framework-bulk which is linked from Django Rest Framework's documentation: http://www.django-rest-framework.org/topics/third-party-resources#views

'Implements generic view mixins as well as some common concrete generic views to allow to apply bulk operations via API requests.'

I'm not sure if it's the 'right™' way of doing it but the library is being actively maintained and it's 9 months old and seems to have a few contributors. Worth looking into.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.