Skip to content

AND clause used instead of OR while filtering #1519

Open
@belavaishali

Description

@belavaishali

Note: for support questions, please use stackoverflow. This repository's issues are reserved for feature requests and bug reports.

  • What is the current behavior?
    So currently on using a Filterset class graphene-django filter is used, which uses AND instead of OR for lookup "IN"

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
    a github repo, https://repl.it or similar (you can use this template as a starting point: https://repl.it/@jkimbo/Graphene-Django-Example).

class ExampleFilterSet(FilterSet):    
    label__name__in = StringInFilter(method="filter_labels")

    class Meta:
        model = Example
        fields = {"users__email": ["in"]}

Ideally, here it should have been OR query - where users__email in ['abc@gmail.com' , 'xyz@gmail.com'] but on debugging it simply empties the clone object and returns empty qs.

It was working well with django3.1 and graphene-django 2.9.9

  • What is the expected behavior?
    The OR clause should be there in the ultimate sql query formed

  • What is the motivation / use case for changing the behavior?
    carry the normal functioning

  • Please tell us about your environment:

    • Version: 3.1.2
    • Platform: macos
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions