Ignore:
Timestamp:
Oct 25, 2008, 2:50:44 PM (16 years ago)
Author:
broder
Message:

Add the CDROM mirrors table

File:
1 edited

Legend:

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

    r1174 r1247  
    6363       Column('pae', Boolean, nullable=False))
    6464
     65mirrors_table = Table('mirrors', meta,
     66       Column('mirror_id', String, primary_key=True, nullable=False),
     67       Column('uri_prefix', String, nullable=False))
     68
    6569cdroms_table = Table('cdroms', meta,
    6670       Column('cdrom_id', String, primary_key=True, nullable=False),
    67        Column('description', String, nullable=False))
     71       Column('description', String, nullable=False),
     72       Column('mirror_id', String, ForeignKey('mirrors.mirror_id'),
     73       Column('uri_suffix', String))
    6874
    6975autoinstalls_table = Table('autoinstalls', meta,
     
    99105        return "<Type %s: %s>" % (self.type_id, self.description)
    100106
     107class Mirror(object):
     108    def __repr__(self):
     109        return "<Mirror %s>" % (self.mirror_id)
     110
    101111class CDROM(object):
    102112    def __repr__(self):
     
    116126session.mapper(Disk, disk_table)
    117127session.mapper(Type, types_table)
     128session.mapper(Mirror, mirrors_table)
    118129session.mapper(CDROM, cdroms_table)
    119130session.mapper(Autoinstall, autoinstalls_table)
Note: See TracChangeset for help on using the changeset viewer.