Answers for "q fields django Q objects"

0

q fields django Q objects

>>> from django.db.models import Q
>>> queryset = User.objects.filter(
    Q(first_name__startswith='R') | Q(last_name__startswith='D')
)
>>> queryset
<QuerySet [<User: Ricky>, <User: Ritesh>, <User: Radha>, <User: Raghu>, <User: rishab>]>
Posted by: Guest on July-08-2021

Python Answers by Framework

Browse Popular Code Answers by Language