-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Nested fields when using Meta.fields = '__all__' are not detected? #268
Comments
Can I see how the |
Sorry, there you have more and better code. This is how it is |
I think you might have a problem somewhere else in your code, I've copied your example as it is and tested it on my side but I've not encountered that error, I even copied your payload and this is what I got on my side after running it
Below is the payload that I sent {
"title": "Hello there",
"holdback_groups": {
"create": [
{
"name": "somename3"
}
]
}
} I added the title because it was required. I even tried including sample groups with the payload below {
"title": "Hello there",
"holdback_groups": {
"create": [
{
"name": "somename3",
"sample_groups": {
"create": [{"name": "This is sample group"}]
}
}
]
}
} And below is the response that I got
|
Hi! , I have two serializers, one nested into the other. If I use the flag all in the Meta.fields in the nested serializer. I have the following error:
The field 'sample_groups' was declared on serializer HoldbackGroupSerializer, but has not been included in the 'fields' option.
Here is the code of the serializers
Here are the models:
If I try to create a
HoldBackGroup
posting to it's endpoint, it works ok (I post some other fields without sublocations).But when I try to create a Holdback with a nested HoldbackGroup I have that error.
I am posting this payload:
And having this error:
The field 'sample_groups' was declared on serializer HoldbackGroupSerializer, but has not been included in the 'fields' option.
The text was updated successfully, but these errors were encountered: