Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django filter multiple conditions

from django.db.models import Q

ticket_query = request.event.tickets.filter(Q(status='on-sale') | Q(status='paused')).prefetch_related('ticket_tax')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django #filter #multiple #conditions
ADD COMMENT
Topic
Name
4+4 =