Serializer is_valid() keeps saying that primary key related field is required even when it is provided??? #8747
Unanswered
123epsilon
asked this question in
Potential Issue
Replies: 0 comments
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.
-
My issue is exactly the same one as described here: https://django.fun/en/qa/382239/
I have no idea why this is happening, I have a model and serializer:
When I try to create an object, I can't get past the serializer validation stage. If I create a BusinessProfile object with id 1, then I should be able to create an opening hours entry like this:
Instead I get
What am I doing wrong here? A similar strategy works without error when I am using a OneToOneField but in this case I need the related field to be a ForeignKey.
Beta Was this translation helpful? Give feedback.
All reactions