saleor/graphql/utils.py
def filter_by_query_param(queryset, query, search_fields):
    """Filter queryset according to given parameters.

    Keyword arguments:
    queryset - queryset to be filtered
    query - search string
    search_fields - fields considered in filtering
    """
    if query:
        query_by = {
            '{0}__{1}'.format(
                field, 'icontains'): query for field in search_fields}
        query_objects = Q()
        for q in query_by:
            query_objects |= Q(**{q: query_by[q]})
        return queryset.filter(query_objects).distinct()
    return queryset
Filter queryset according to given parameters.

    Keyword arguments:
    queryset - queryset to be filtered
    query - search string
    search_fields - fields considered in filtering
    
Filter queryset according to given parameters.
Keyword arguments:
queryset - queryset to be filtered
query - search string
search_fields - fields considered in filtering
Filter queryset according to given parameters . Keyword arguments : queryset - queryset to be filtered query - search string search_fields - fields considered in filtering
def filter_by_query_param(queryset, query, search_fields):
    if query:
        query_by = {
            '{0}__{1}'.format(
                field, 'icontains'): query for field in search_fields}
        query_objects = Q()
        for q in query_by:
            query_objects |= Q(**{q: query_by[q]})
        return queryset.filter(query_objects).distinct()
    return queryset
def filter_by_query_param ( queryset , query , search_fields ) : if query : query_by = { '{0}__{1}' . format ( field , 'icontains' ) : query for field in search_fields } query_objects = Q ( ) for q in query_by : query_objects |= Q ( ** { q : query_by [ q ] } ) return queryset . filter ( query_objects ) . distinct ( ) return queryset
Filter queryset according to given parameters.
Filter queryset according to given parameters .
"""Filter queryset according to given parameters.

    Keyword arguments:
    queryset - queryset to be filtered
    query - search string
    search_fields - fields considered in filtering
    """
queryset
query
search_fields