Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1659d8c

Browse files
Darkheirmblayman
authored andcommittedJun 28, 2017
Respect lookup field on many-many relations (#361)
1 parent 415efa0 commit 1659d8c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎rest_framework_json_api/renderers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@ def extract_relationships(cls, fields, resource, resource_instance):
189189
'data': resource.get(field_name)
190190
}
191191

192-
field_links = field.child_relation.get_links(resource_instance)
192+
field_links = field.child_relation.get_links(
193+
resource_instance,
194+
field.child_relation.related_link_lookup_field
195+
)
193196
relation_data.update(
194197
{'links': field_links}
195198
if field_links else dict()

0 commit comments

Comments
 (0)
Please sign in to comment.