(search_fields, query_string)
return reduce(Q.__and__, filters) if len(filters) else Q(pk=None)
search_fields example: ['name', 'category__name', '@description', '=id']
search_fields example: ['name', 'category__name', '
search_fields example : [ name category__name
def search_filter(search_fields, query_string):
    """search_fields example: ['name', 'category__name', '@description', '=id']
    """

    query_string = query_string.strip()

    filters = []
    first = True

    for bit in split_text_query(query_string):

        queries = [Q(**{search_param(field_name, first): bit}) for field_name in search_fields]
        filters.append(reduce(Q.__or__, queries))
        first = False

    return reduce(Q.__and__, filters) if len(filters) else Q(pk=None)
def search_filter ( search_fields , query_string ) : query_string = query_string . strip ( ) filters = [ ] first = True for bit in split_text_query ( query_string ) : queries = [ Q ( * * { search_param ( field_name , first ) : bit } ) for field_name in search_fields ] filters . append ( reduce ( Q . __or__ , queries ) ) first = False return reduce ( Q . __and__ , filters ) if len ( filters ) else Q ( pk = None )