Skip to content

Support many=True on related serializer method fields. #223

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
merged 3 commits into from
Apr 12, 2016

Conversation

jerel
Copy link
Member

@jerel jerel commented Apr 12, 2016

Replaces #151. Fixes #220.

I'd like some review and it'd be great if you could pull this into your project and give it a test drive.

@jsenecal
Copy link
Member

I reviewed the code, while I cant test on any project I am currently working on, I don't think this should break anything :)

@jerel jerel merged commit b2728e4 into develop Apr 12, 2016
@@ -31,7 +31,7 @@ def test_included_data_on_detail(single_entry, client):

def test_dynamic_related_data_is_included(single_entry, entry_factory, client):
entry_factory()
response = client.get(reverse("entry-detail", kwargs={'pk': single_entry.pk}) + '?include=suggested')
response = client.get(reverse("entry-detail", kwargs={'pk': single_entry.pk}) + '?include=featured')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jerel why was the test changed here? I get a failure when including a SerializerMethodResourceRelatedField, is this intentional?

The failure is 'function' object has no attribute 'parent'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also a bit surprised by this change. However this is a two year old PR and things might have changed as well so maybe not the right place to discuss this.

I guess if you have issues including a SerializerMethodResourceRelatedField(many=True) best open a new issue with a code example. Or even better a PR if you already see where the error lies. Thanks.

@sliverc sliverc deleted the bugfix/many-serializer-method-field branch December 14, 2018 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants