Answer the question
In order to leave comments, you need to log in
How to implement logical OR in django?
How to correctly implement the request? The bottom line is, there is a search and it should look for matches in any of the three fields.
client = Client.objects.filter(Q(name = search) | Q(email = search) | Q(adres = search))
client = Client.objects.filter(Q(name = search) | Q(email = search))
Answer the question
In order to leave comments, you need to log in
Maybe it will go like this?
client = Client.objects.filter(Q(name__exact=search) | Q(email__exact=search) | Q(adres__exact=search))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question