@expose("json", allow_json=True) def group_list(self, search='*'): re_search = re.sub(r'\*', r'%', search).lower() groups = Groups.query.filter(Groups.name.like(re_search)).order_by('name') return groups