def row_to_entity(row): spot_entity = Spot() spot_entity.id = row.id spot_entity.name = row.name spot_entity.position = GeoPoint.row_to_object(row.position) spot_entity.tags = row.tags spot_entity.tracks_current = [Track.row_to_object(track_row) for track_row in row.tracks_current] spot_entity.tracks_old = [Track.row_to_object(track_row) for track_row in row.tracks_old] return spot_entity
def row_to_object(row): checkpoint = Checkpoint() checkpoint.id = row.id checkpoint.location = GeoPoint.row_to_object(row.location) return checkpoint