Skip to content

Fix dotted source ordering #5533

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

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy