-
Notifications
You must be signed in to change notification settings - Fork 301
Incorrect type. Expected pk value, received OrderedDict when updating a relationship #111
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
Comments
I would say that this commit title says it all: 'Relationships parsing are now only handled by compatible fields' In more details: another field was introduced shortly around the time of that commit (23d0af6) ResourceRelatedField handles the JSONAPI spec completely and should replace any related fields you might want to use - Both for performance and features. Let me know if you need more help on this. |
Just noticed that I didn't mention that I send this data via PATCH. |
It means that the parser now only parses |
Is that error only shown for this one issue? If so perhaps we could improve the error with something like " |
@jerel we would require to override ALL DRF related fields in that case as we cant get the serializers fields from the parser |
@schtibe can you try to use the ResourceRelatedField and give us an update on this issue ? |
@jsenecal yes it seems to work, thank you! |
Although using ResourceRelatedField makes it mandatory, even though I added allow_null=True |
Does your model also have the relationship set to |
Also, the setting is usually required=false on the relations field... See http://www.django-rest-framework.org/api-guide/serializers/#validation there is a note about this... |
It was required=false. Thanks |
I get this error:
since commit d654c75 when I run my unit test. The data I send is
What is that change for / is my data wrong?
The text was updated successfully, but these errors were encountered: