-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to bulk update/insert via nested url? #131
Comments
As you are using drf-nested-router, I assume you want to adhere to the rest architecture.
Doing so is not recommended by REST architecture. As REST architecture provide CRUD operations( This can be easily achived by adding a |
@himanshu-singh1995 Can you provide a link to clarify that comment? Where did you get that? |
Well, this is very debatable @himanshu-singh1995. Some would say that using nested objects is not RESTful just to start. My position is that a POST with a list on the @simkimsia I would answer as if every member of the list had been POSTed alone. On the view, you can differentiate by verifying if the request cames with a dict or a list on the 1st level, for example. However, is just an opinion. |
Using the nameserver and domain example, I like to send a list of domains to the nested route
/nameservers/{nameserver-pk}/domains
and then I can write code to decide to which domain is supposed to be a brand new record or which domain is supposed to update.
How do I do that using nested-routers?
I am okay to write my own code, I am not sure how to use the right viewset and serializer for this.
The text was updated successfully, but these errors were encountered: