Skip to content

django-filter: resolve field along with lookup expression to properly lookup form field #805

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 4 commits into from
Nov 28, 2019

Conversation

zbyte64
Copy link
Collaborator

@zbyte64 zbyte64 commented Oct 21, 2019

Attempt to fix #781 , here are somethings I didn't know when I started:

filter.tests.test_filter_filterset_based_on_mixin (

def test_filter_filterset_based_on_mixin():
) demonstrates the ability to have the django-filter expression be based off a graphene method. In this example viewer is virtually mapped to an article as a reporter and is queried as viewer__email__in. This means we need to power our field lookup with filter_field.field_name and not the key name.

Another assumption violated is that only the last part specifies nonfield processing, it seems django can now chain some functions into the query, ie: __lower__first3chars__reversed https://docs.djangoproject.com/en/2.2/ref/models/lookups/#query-expression
I don't know how our system performs with that feature.

@zbyte64 zbyte64 requested a review from jkimbo October 21, 2019 20:06
@jkimbo
Copy link
Member

jkimbo commented Nov 28, 2019

Sorry for the late review on this @zbyte64 . Merging now.

@jkimbo jkimbo merged commit 3ce4490 into graphql-python:master Nov 28, 2019
@zbyte64 zbyte64 deleted the fix_781 branch December 1, 2019 17:51
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.

Filtering not working correctly with 2.6.0
2 participants