Exemple #1
0
def floors():
    cur = get_cursor()
    building = request.args.get('building')
    cur.execute('select distinct floor from rooms where building = ?', (building,))
    return jsonify({
        'building': building,
        'floors': to_array(cur.fetchall())})
Exemple #2
0
def rooms():
    cur = get_cursor()
    building = request.args.get('building')
    floor = request.args.get('floor')
    cur.execute('select room from rooms where building = ? and floor = ?', (building, floor))
    return jsonify({
        'building': building,
        'floor': floor,
        'rooms': to_array(cur.fetchall())
        })
Exemple #3
0
def buildings():
    cur = get_cursor()
    cur.execute('select distinct building from rooms')
    r = cur.fetchall()
    return jsonify({'buildings': to_array(r)})