Skip to content
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

Fix dotted source ordering #5533

Merged

Conversation

carltongibson
Copy link
Collaborator

Replaces #5525.

Comment from original PR:

I ran into an issue the other day where a serializer referring to a field in a related object didn't provide the correct field name for the ordering filter backend.

Updating the get_default_valid_fields method so that for dotted sources the . for __ fixes my use case.

I just added a test to check the non-dotted source didn't raise an AttributeError calling replace on None. (It doesn't: Serializer.fields provides a sensible source even when None on the field.)

@carltongibson carltongibson added this to the 3.7.2 milestone Oct 25, 2017
@carltongibson carltongibson merged commit 1f693c3 into encode:master Oct 25, 2017
@carltongibson carltongibson deleted the 372/5525-dotted-source-ordering branch October 25, 2017 09:46
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.

2 participants