From 5ee142854cff1ace07f40fcf600814f5b70203d3 Mon Sep 17 00:00:00 2001 From: Eric Price Date: Mon, 21 Apr 2008 22:50:54 -0400 Subject: [PATCH] Support autoinstalls table for creation list. svn path=/trunk/packages/sipb-xen-database/; revision=443 --- debian/changelog | 6 ++++++ sipb_xen_database/models.py | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 51b1d21..ae7e76b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sipb-xen-database (10.6) unstable; urgency=low + + * Support autoinstalls table. + + -- Eric Price Mon, 21 Apr 2008 22:34:46 -0400 + sipb-xen-database (10.5) unstable; urgency=low * Enable USB tablet device in guests. diff --git a/sipb_xen_database/models.py b/sipb_xen_database/models.py index b075886..3f54821 100644 --- a/sipb_xen_database/models.py +++ b/sipb_xen_database/models.py @@ -12,12 +12,15 @@ __all__ = ['meta', 'disk_table', 'types_table', 'cdroms_table', + 'autoinstalls_table', 'Machine', 'MachineAccess', 'NIC', 'Disk', 'Type', - 'CDROM'] + 'CDROM', + 'Autoinstall', + ] meta = DynamicMetaData() ctx = SessionContext(create_session) @@ -58,6 +61,11 @@ cdroms_table = Table('cdroms', meta, Column('cdrom_id', String, primary_key=True, nullable=False), Column('description', String, nullable=False)) +autoinstalls_table = Table('autoinstalls', meta, + Column('autoinstall_id', String, primary_key=True, nullable=False), + Column('description', String, nullable=False), + Column('type_id', String, ForeignKey('types.type_id'), nullable=False)) + machine_access_table = Table('machine_access', meta, Column('machine_id', Integer, ForeignKey('machines.machine_id'), nullable=False, index=True), Column('user', String, nullable=False, index=True), @@ -87,6 +95,10 @@ class CDROM(object): def __repr__(self): return "" % (self.cdrom_id, self.description) +class Autoinstall(object): + def __repr__(self): + return "" % (self.autoinstall_id, self.description, self.type.type_id) + assign_mapper(ctx, Machine, machine_table, properties={'nics': relation(NIC, backref="machine"), 'disks': relation(Disk, backref="machine"), @@ -97,6 +109,7 @@ 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) def clear_cache(): """Clear sqlalchemy's cache. -- 1.7.9.5