def match(): dataset_arg = request.args.get('dataset') dataset = Dataset.find(dataset_arg) matches = find_matches(dataset, request.args.get('name'), filter=request.args.get('filter'), exclude=arg_int('exclude')) return query_pager(matches)
def get_offset(default=0, field='offset'): return max(0, arg_int(field, default=default))
def get_limit(default=50, field='limit'): return max(0, min(1000, arg_int(field, default=default)))