def get_query(request,field_list):
query = request.GET.get('query','')
q = Q()
q.connect = 'OR'
for field in field_list:
q.children.append( Q( ('{}__icontains'.format(field),query ) ) )
return q
def get_query(request,field_list):
query = request.GET.get('query','')
q = Q()
q.connect = 'OR'
for field in field_list:
q.children.append( Q( ('{}__icontains'.format(field),query ) ) )
return q