Allow administrators. sipb-xen-database/8
authorEric Price <ecprice@mit.edu>
Wed, 10 Oct 2007 04:05:03 +0000 (00:05 -0400)
committerEric Price <ecprice@mit.edu>
Wed, 10 Oct 2007 04:05:03 +0000 (00:05 -0400)
svn path=/trunk/packages/sipb-xen-database/sipb-xen-database/; revision=168

sipb_xen_database/models.py

index 4226598..b4380b9 100644 (file)
@@ -26,7 +26,7 @@ machine_table = Table('machines', meta,
        Column('owner', String, nullable=False),
        Column('contact', String, nullable=False),
        Column('uuid', String, nullable=False),
-       Column('boot_off_cd', Boolean, nullable=False, default=False),
+       Column('administrator', String, nullable=False, default=False),
        Column('type_id', String, ForeignKey('types.type_id'), nullable=False),
        Column('autorestart', Boolean, nullable=False, default=False),
        Column('cpus', Integer, nullable=False, default=1))
@@ -80,9 +80,9 @@ class CDROM(object):
         self.cdrom_id = cdrom_id
         self.description = description
 
-assign_mapper(ctx, Machine, machine_table, \
-              properties={'nics': relation(NIC),
-                          'disks': relation(Disk),
+assign_mapper(ctx, Machine, machine_table,
+              properties={'nics': relation(NIC, backref="machine"),
+                          'disks': relation(Disk, backref="machine"),
                           'type': relation(Type)});
 assign_mapper(ctx, NIC, nic_table)
 assign_mapper(ctx, Disk, disk_table)