def make_default_user_query(users, query_data, values, search_on, extra_data={}):
    """
    given a query_data dict and values which come from the ui,
    generate a dict that will be used for a user query

    this default query is a within query, that optionally adds some
    extra key/value data to the query dict
    """

    query = {}

    query_str = query_data['query']
    within = query_str + '__in'
    query[within] = values

    extra_info = query_data.get('extra')
    if extra_info:
        query.update(extra_info)


    if extra_data.get('istoggle', True):
        users = users.filter(**query)
        human_query = u"%s is in (%s)" % (search_on, u', '.join(values))
    else:
        users = users.exclude(**query)
        human_query = u"%s is not in (%s)" % (search_on, u', '.join(values))
    return users, human_query