-assign_mapper(ctx, Machine, machine_table,
- properties={'nics': relation(NIC, backref="machine", lazy=False),
- 'disks': relation(Disk, backref="machine", lazy=False),
- 'type': relation(Type, lazy=False),
- 'acl': relation(MachineAccess, backref="machine", lazy=False, passive_deletes=True, cascade="all, delete-orphan")});
-assign_mapper(ctx, MachineAccess, machine_access_table)
-assign_mapper(ctx, NIC, nic_table)
-assign_mapper(ctx, Disk, disk_table)
-assign_mapper(ctx, Type, types_table)
-assign_mapper(ctx, CDROM, cdroms_table)
-assign_mapper(ctx, Autoinstall, autoinstalls_table)
+from owner import Owner
+
+session.mapper(Machine, machine_table,
+ properties={'nics': relation(NIC, backref="machine"),
+ 'disks': relation(Disk, backref="machine"),
+ 'type': relation(Type),
+ 'acl': relation(MachineAccess, backref="machine", passive_deletes=True, cascade="all, delete-orphan")});
+session.mapper(MachineAccess, machine_access_table)
+session.mapper(NIC, nic_table)
+session.mapper(Disk, disk_table)
+session.mapper(Type, types_table)
+session.mapper(Mirror, mirrors_table)
+session.mapper(CDROM, cdroms_table,
+ properties={'mirror': relation(Mirror, backref="cdroms")})
+session.mapper(Autoinstall, autoinstalls_table)
+session.mapper(Owner, owners_table)