- Timestamp:
- Oct 7, 2007, 1:12:18 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-database/sipb-xen-database/sipb_xen_database/models.py
r107 r108 10 10 'disk_table', 11 11 'types_table', 12 'cdroms_table', 12 13 'Machine', 13 14 'NIC', 14 15 'Disk', 15 'Type'] 16 'Type', 17 'CDROM'] 16 18 17 19 meta = DynamicMetaData() … … 50 52 Column('pae', Boolean, nullable=False)) 51 53 54 cdroms_table = Table('cdroms', meta, 55 Column('cdrom_id', String, primary_key=True, nullable=False), 56 Column('description', String, nullable=False)) 57 52 58 53 59 class Machine(object): … … 62 68 63 69 class Disk(object): 64 pass 70 def __init__(self, machine_id, guest, size): 71 self.machine_id = machine_id 72 self.guest_device_name = guest 73 self.size = size 65 74 66 75 class Type(object): 67 76 pass 68 77 78 class CDROM(object): 79 def __init__(self, cdrom_id, description): 80 self.cdrom_id = cdrom_id 81 self.description = description 69 82 70 83 assign_mapper(ctx, Machine, machine_table, \ … … 74 87 assign_mapper(ctx, Disk, disk_table) 75 88 assign_mapper(ctx, Type, types_table) 89 assign_mapper(ctx, CDROM, cdroms_table) 76 90
Note: See TracChangeset
for help on using the changeset viewer.