We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f9eb277 commit 9514381Copy full SHA for 9514381
rest_framework_json_api/utils.py
@@ -219,6 +219,12 @@ def get_related_resource_type(relation):
219
# For ManyToMany relationships, get the model from the child
220
# serializer of the list serializer
221
relation_model = relation.child.Meta.model
222
+ elif (
223
+ hasattr(relation, "child_relation")
224
+ and hasattr(relation.child_relation, "model")
225
+ ):
226
+ # For ManyRelatedField relationships, get the model from the child relationship
227
+ relation_model = relation.child_relation.model
228
else:
229
parent_serializer = relation.parent
230
parent_model = None
0 commit comments