Exemple #1
0
def add_immobile_object(data):
    db_wrapper = DBWrapper()
    result = db_wrapper.execute(
        Q.ADD_IMMOBILE_OBJECT % (data['name'], data.get(
            'phone', ''), data['latitude'], data['longitude']))
    db_wrapper.dispose()
    return result
Exemple #2
0
def update_immobile_object(id, data):
    db_wrapper = DBWrapper()
    result = db_wrapper.execute(
        Q.UPDATE_IMMOBILE_OBJECT % (data['name'], data.get(
            'phone', ''), data['latitude'], data['longitude'], id))
    db_wrapper.dispose()
    return result
Exemple #3
0
def add_location_point(movable_object_id, hour, minute, second, latitude,
                       longitude):
    db_wrapper = DBWrapper()
    result = db_wrapper.execute(
        Q.ADD_LOCATION_POINT %
        (movable_object_id, hour, minute, second, latitude, longitude))
    db_wrapper.dispose()
    return result
Exemple #4
0
def delete_movable_object(id):
    db_wrapper = DBWrapper()
    db_wrapper.execute(Q.DELETE_MOVABLE_OBJECT % id)
    db_wrapper.dispose()
    return True
Exemple #5
0
def delete_immobile_object(id):
    db_wrapper = DBWrapper()
    db_wrapper.execute(Q.DELETE_IMMOBILE_OBJECT % id)
    db_wrapper.dispose()
    return True
Exemple #6
0
def add_immobile_object(data):
    db_wrapper = DBWrapper()
    result = db_wrapper.execute(Q.ADD_IMMOBILE_OBJECT % (data['name'], data.get('phone', ''), data['latitude'], data['longitude']))
    db_wrapper.dispose()
    return result
Exemple #7
0
def update_movable_type(id, data):
    db_wrapper = DBWrapper()
    result = db_wrapper.execute(Q.UPDATE_MOVABLE_TYPE % (data['name'], id))
    db_wrapper.dispose()
    return result
Exemple #8
0
def delete_movable_type(id):
    db_wrapper = DBWrapper()
    db_wrapper.execute(Q.DELETE_MOVABLE_TYPE % id)
    db_wrapper.dispose()
    return True
Exemple #9
0
def update_movable_type(id, data):
    db_wrapper = DBWrapper()
    result = db_wrapper.execute(Q.UPDATE_MOVABLE_TYPE % (data['name'], id))
    db_wrapper.dispose()
    return result
Exemple #10
0
def add_movable_type(data):
    db_wrapper = DBWrapper()
    result = db_wrapper.execute(Q.ADD_MOVABLE_TYPE % (data['name']))
    db_wrapper.dispose()
    return result
Exemple #11
0
def delete_movable_type(id):
    db_wrapper = DBWrapper()
    db_wrapper.execute(Q.DELETE_MOVABLE_TYPE % id)
    db_wrapper.dispose()
    return True
Exemple #12
0
def update_movable_object(id, movable_type_id, data):
    db_wrapper = DBWrapper()
    result = db_wrapper.execute(Q.UPDATE_MOVABLE_OBJECT % (data['name'],movable_type_id, id))
    db_wrapper.dispose()
    return result
Exemple #13
0
def add_movable_object(movable_type_id, data):
    db_wrapper = DBWrapper()
    result = db_wrapper.execute(Q.ADD_MOVABLE_OBJECT % (data['name'], movable_type_id))
    db_wrapper.dispose()
    return result
Exemple #14
0
def delete_movable_object(id):
    db_wrapper = DBWrapper()
    db_wrapper.execute(Q.DELETE_MOVABLE_OBJECT % id)
    db_wrapper.dispose()
    return True
Exemple #15
0
def update_immobile_object(id, data):
    db_wrapper = DBWrapper()
    result = db_wrapper.execute(Q.UPDATE_IMMOBILE_OBJECT % (data['name'], data.get('phone', ''), data['latitude'], data['longitude'], id))
    db_wrapper.dispose()
    return result
Exemple #16
0
def add_movable_object(movable_type_id, data):
    db_wrapper = DBWrapper()
    result = db_wrapper.execute(Q.ADD_MOVABLE_OBJECT %
                                (data['name'], movable_type_id))
    db_wrapper.dispose()
    return result
Exemple #17
0
def update_movable_object(id, movable_type_id, data):
    db_wrapper = DBWrapper()
    result = db_wrapper.execute(Q.UPDATE_MOVABLE_OBJECT %
                                (data['name'], movable_type_id, id))
    db_wrapper.dispose()
    return result
Exemple #18
0
def add_location_point(movable_object_id , hour, minute, second, latitude, longitude):
    db_wrapper = DBWrapper()
    result = db_wrapper.execute(Q.ADD_LOCATION_POINT % (movable_object_id , hour, minute, second, latitude, longitude))
    db_wrapper.dispose()
    return result
Exemple #19
0
def add_movable_type(data):
    db_wrapper = DBWrapper()
    result = db_wrapper.execute(Q.ADD_MOVABLE_TYPE % (data['name']))
    db_wrapper.dispose()
    return result
Exemple #20
0
def delete_all_location_points_for(id):
    db_wrapper = DBWrapper()
    db_wrapper.execute(Q.DELETE_LOCATION_POINTS_FOR % id)
    db_wrapper.dispose()
Exemple #21
0
def delete_all_location_points_for(id):
    db_wrapper = DBWrapper()
    db_wrapper.execute(Q.DELETE_LOCATION_POINTS_FOR % id)
    db_wrapper.dispose()
Exemple #22
0
def delete_immobile_object(id):
    db_wrapper = DBWrapper()
    db_wrapper.execute(Q.DELETE_IMMOBILE_OBJECT % id)
    db_wrapper.dispose()
    return True