Model Serializers and Multiple Entries #8542
Unanswered
patagoniapy
asked this question in
General
Replies: 1 comment
-
The mixins actually provide methods independently from one another. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I recently stumbled upon what I thought would be a fairly common use case, and therefore supported by DRF out of the box, but this wasn't the case (unless I'm doing something wrong, which is very likely)
Here's an overview
I had the model
Transaction Detail
Which I was serializing using
ModelSerializer
And accessing with this view
All was well if I was submitting one
Transaction Detail
, but as soon as I tried to pass something like below, I got the errorExpected a dictionary, but got a list
I was able to solve this by following this thread
My first question is if I'm missing anything that would allow DRF to behave this way out of the box?
If not, then my second question is why isn't this the default behavior in DRF? It's hard for me to see the downside in running this logic, and the amount of questions about this on StackOverflow lead me to believe it's a fairly common application.
Beta Was this translation helpful? Give feedback.
All reactions