We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am using json:api with python with a class that looks like this:
class ChildrenResultSerializer(JSONAPISerializer): children = fields.List(fields.Nested(ChildSerializer), allow_none=True)
and the other one looks like this:
class ChildSerializer(JSONAPISerializer): toys = fields.Relationship( many=True, type_="toys", include_resource_linkage=True, schema=ToySerializer, allow_none=True, )
In the ChildrenResultSerializer.serialize function, I want to be able to see the toys data for each of the children. I'm using it like this:
ChildrenResultSerializer.serialize(results, include_data=("children.toys"))
but I get this error: ValueError: Can only include relationships. "children" is a "List"
ValueError: Can only include relationships. "children" is a "List"
what am I doing wrong? I would like to keep children as a list of nested if possible.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am using json:api with python with a class that looks like this:
and the other one looks like this:
In the ChildrenResultSerializer.serialize function, I want to be able to see the toys data for each of the children. I'm using it like this:
but I get this error:
ValueError: Can only include relationships. "children" is a "List"
what am I doing wrong? I would like to keep children as a list of nested if possible.
The text was updated successfully, but these errors were encountered: