https://docs.djangoproject.com/en/3.0/topics/db/queries/#complex-lookups-with-q-objects
On Fri, Jan 10, 2020 at 7:54 PM Ezequias Rocha <[email protected]> wrote: > Hi everyone > > I am using a dynamic filter and I am building my own arguments at runtime. > > The problem I am focusing is when I want my filter operates as an OR > conditional. I am using the following way to do the AND filter > > data = { > 'name': 'John', > 'age': 42, > } > > model.filter(**data) > > It works but all conditions in data dictionary are treated as an *AND * > operator. > > Does anyone knows how to apply the *OR *(|) condition to this filter? > > My best regards > Ezequias Rocha > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/8f61aabe-9faf-4291-bb7e-4b403ea13e5a%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/8f61aabe-9faf-4291-bb7e-4b403ea13e5a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAF6Fyj3QjMkx9xUfaTH9Q03zhKj1BJn0KfSctUpvp_ZkCe9qOA%40mail.gmail.com.

