Exemplo n.º 1
0
def get_sensors(id):
    station = Stations.query.get_or_404(id)
    page = request.args.get('page', 1, type=int)
    per_page = min(request.args.get('per_page', 10, type=int), 100)
    data = Station.collect(station.sensors,
                           page,
                           per_page,
                           'get_sensors',
                           id=id)
    return jsonify(data)
Exemplo n.º 2
0
def get_stations():
    page = request.args.get('page', 1, type=int)
    per_page = min(request.args.get('per_page', 10, type=int), 100)
    data = Station.collect(Station.query, page, per_page, 'get_stations')
    return jsonify(data)