Exemple #1
0
def convert_user_tag_to_query(key, value):
    """
    Converts a user tag to a query string that can be used to search for that
    user. Returns None if not a user tag.
    """
    if key == "user" and ":" in value:
        sub_key, value = value.split(":", 1)
        if KEYWORD_MAP.get_key(sub_key, None):
            return 'user.%s:"%s"' % (sub_key, value.replace('"', '\\"'))
Exemple #2
0
def convert_user_tag_to_query(key, value):
    """
    Converts a user tag to a query string that can be used to search for that
    user. Returns None if not a user tag.
    """
    if key == 'user' and ':' in value:
        sub_key, value = value.split(':', 1)
        if KEYWORD_MAP.get_key(sub_key, None):
            return 'user.%s:%s' % (sub_key, value)
Exemple #3
0
def convert_user_tag_to_query(key, value):
    """
    Converts a user tag to a query string that can be used to search for that
    user. Returns None if not a user tag.
    """
    if key == 'user' and ':' in value:
        sub_key, value = value.split(':', 1)
        if KEYWORD_MAP.get_key(sub_key, None):
            return 'user.%s:%s' % (sub_key, value)