Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

SerializerMethodResourceRelatedField with many=True does not show up in included #260

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

Merged
jerel merged 2 commits into django-json-api:develop from tbartelmess:fix/include-in-many-related-serializer
Aug 18, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use the presense of ‘child_relation’ in kwargs to see if it’s a many ...
...relationship
  • Loading branch information
tbartelmess committed Jul 19, 2016
commit c1049e48182e98cec7f00bae8cc3cfca37cd74f8
7 changes: 6 additions & 1 deletion rest_framework_json_api/renderers.py
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,12 @@ def extract_included(fields, resource, resource_instance, included_resources):
serializer_class = included_serializers.get(field_name)
if relation_instance_or_manager is None:
continue
field = serializer_class(relation_instance_or_manager, context=context)

many = field._kwargs.get('child_relation', None) is not None

field = serializer_class(relation_instance_or_manager,
many=many,
context=context)
serializer_data = field.data

if isinstance(field, ListSerializer):
Expand Down

AltStyle によって変換されたページ (->オリジナル) /