Changeset 2132 for trunk/packages/invirt-database/python/database
- Timestamp:
- Feb 16, 2009, 11:52:01 PM (16 years ago)
- Location:
- trunk/packages/invirt-database/python/database
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-database/python/database/models.py
r1714 r2132 17 17 'mirrors_table', 18 18 'autoinstalls_table', 19 'owners_table', 19 20 'Machine', 20 21 'MachineAccess', … … 25 26 'Mirror', 26 27 'Autoinstall', 28 'Owner', 27 29 'or_', 28 30 ] … … 83 85 Column('arch', String, nullable=False)) 84 86 87 owners_table = Table('owners', meta, 88 Column('owner_id', String, primary_key=True, nullable=False), 89 Column('ram_quota_total', Integer, nullable=True), 90 Column('ram_quota_single', Integer, nullable=True)) 91 85 92 machine_access_table = Table('machine_access', meta, 86 93 Column('machine_id', Integer, ForeignKey('machines.machine_id', ondelete='CASCADE'), nullable=False, index=True), … … 120 127 return "<Autoinstall %s: %s (%s)>" % (self.autoinstall_id, self.description, self.type.type_id) 121 128 129 from owner import Owner 130 122 131 session.mapper(Machine, machine_table, 123 132 properties={'nics': relation(NIC, backref="machine"), … … 133 142 properties={'mirror': relation(Mirror, backref="cdroms")}) 134 143 session.mapper(Autoinstall, autoinstalls_table) 144 session.mapper(Owner, owners_table) 135 145 136 146 def clear_cache():
Note: See TracChangeset
for help on using the changeset viewer.