Exemplo n.º 1
0
Arquivo: api.py Projeto: Yalies/api
def api_people():
    try:
        criteria = request.get_json(force=True) or {}
    except:
        criteria = {}
    people = Person.search(criteria)
    return to_json(people)
Exemplo n.º 2
0
def api_students():
    criteria = request.get_json() or {}
    if not criteria.get('filters'):
        criteria['filters'] = {}
    if not criteria['filters'].get('school_code'):
        criteria['filters']['school_code'] = []
    criteria['filters']['school_code'].append('YC')
    students = Person.search(criteria)
    return to_json(students)
Exemplo n.º 3
0
def api_people():
    criteria = request.get_json() or {}
    people = Person.search(criteria)
    return to_json(people)