Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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>]>
Source by books.agiliq.com #
 
PREVIOUS NEXT
Tagged: #fields #django #Q #objects
ADD COMMENT
Topic
Name
8+9 =