Answers for "operator in django query"

0

or operator in django queryset

from django.db.models import Q

Contact.objects.filter(Q(last_name__icontains=request.POST['query']) | 
                               Q(first_name__icontains=request.POST['query']))
Posted by: Guest on June-18-2020
0

operator in django query

User.objects.filter(id__in=[1, 5, 34, 567, 229])
Posted by: Guest on June-13-2021

Python Answers by Framework

Browse Popular Code Answers by Language