Add attributes to the ORM to link mirrors and cdroms
[invirt/packages/invirt-database.git] / python / database / models.py
index e44aff3..625e04b 100644 (file)
@@ -128,7 +128,8 @@ session.mapper(NIC, nic_table)
 session.mapper(Disk, disk_table)
 session.mapper(Type, types_table)
 session.mapper(Mirror, mirrors_table)
 session.mapper(Disk, disk_table)
 session.mapper(Type, types_table)
 session.mapper(Mirror, mirrors_table)
-session.mapper(CDROM, cdroms_table)
+session.mapper(CDROM, cdroms_table,
+               properties={'mirror': relation(Mirror, backref="cdroms")})
 session.mapper(Autoinstall, autoinstalls_table)
 
 def clear_cache():
 session.mapper(Autoinstall, autoinstalls_table)
 
 def clear_cache():