Exemplo n.º 1
0
def migrate_locations():
    all_locations = model_datastore.get_all_location_updates()
    for update_list in all_locations.values():
        traj = update_list[0]
        if len(traj) > 1:
            model_datastore.store_new_trajectory_update(new_trajectory=traj, \
                                                        drawn_by_hand=False)
    return "Stored em"
Exemplo n.º 2
0
def upload_drawn_path():
    def validate(coord):
        if coord['lat'] == None or coord['lng'] == None:
            raise ValueError
        return coord
    
    path = map(validate, json.loads(request.values.get('path')))  
    
    model_datastore.store_new_trajectory_update(new_trajectory=path, \
                                                drawn_by_hand=True)
    return "just uploaded new trajectory"