def get_network_segments(self, session): with session.begin(subtransactions=True): query = (session.query(models.NetworkSegment).order_by( models.NetworkSegment.segment_index)) records = query.all() result = {} for record in records: if record.network_id not in result: result[record.network_id] = [] result[record.network_id].append(db._make_segment_dict(record)) return result
def get_network_segments(self, session): with session.begin(subtransactions=True): query = (session.query(models.NetworkSegment). order_by(models.NetworkSegment.segment_index)) records = query.all() result = {} for record in records: if record.network_id not in result: result[record.network_id] = [] result[record.network_id].append(db._make_segment_dict(record)) return result