Ignore:
Timestamp:
Apr 21, 2008, 10:50:54 PM (16 years ago)
Author:
ecprice
Message:

Support autoinstalls table for creation list.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-database/sipb_xen_database/models.py

    r296 r443  
    1313           'types_table',
    1414           'cdroms_table',
     15           'autoinstalls_table',
    1516           'Machine',
    1617           'MachineAccess',
     
    1819           'Disk',
    1920           'Type',
    20            'CDROM']
     21           'CDROM',
     22           'Autoinstall',
     23           ]
    2124
    2225meta = DynamicMetaData()
     
    5962       Column('description', String, nullable=False))
    6063
     64autoinstalls_table = Table('autoinstalls', meta,
     65       Column('autoinstall_id', String, primary_key=True, nullable=False),
     66       Column('description', String, nullable=False),
     67       Column('type_id', String, ForeignKey('types.type_id'), nullable=False))
     68
    6169machine_access_table = Table('machine_access', meta,
    6270       Column('machine_id', Integer, ForeignKey('machines.machine_id'), nullable=False, index=True),
     
    8896        return "<CDROM %s: %s>" % (self.cdrom_id, self.description)
    8997
     98class Autoinstall(object):
     99    def __repr__(self):
     100        return "<Autoinstall %s: %s (%s)>" % (self.autoinstall_id, self.description, self.type.type_id)
     101
    90102assign_mapper(ctx, Machine, machine_table,
    91103              properties={'nics': relation(NIC, backref="machine"),
     
    98110assign_mapper(ctx, Type, types_table)
    99111assign_mapper(ctx, CDROM, cdroms_table)
     112assign_mapper(ctx, Autoinstall, autoinstalls_table)
    100113
    101114def clear_cache():
Note: See TracChangeset for help on using the changeset viewer.