Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR BASIC

Loop inner fiter()

from operator import and_
from django.db.models import Q

categories = ['holiday', 'summer']
res = Photo.filter(reduce(and_, [Q(tags__name=c) for c in categories]))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Loop
ADD COMMENT
Topic
Name
6+3 =