Complete NIPAP prefix type

def complete_tags(arg):
    """ Complete NIPAP prefix type
    """
    search_string = '^'
    if arg is not None:
        search_string += arg

    res = Tag.search({
        'operator': 'regex_match',
        'val1': 'name',
        'val2': search_string
    })

    ret = []
    for t in res['result']:
        ret.append(t.name)

    return ret