Changeset 2135 for trunk/packages/invirt-database
- Timestamp:
- Feb 17, 2009, 2:16:12 AM (16 years ago)
- Location:
- trunk/packages/invirt-database/python/database
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-database/python/database/models.py
r2134 r2135 5 5 from sqlalchemy.ext.sessioncontext import SessionContext 6 6 from sqlalchemy.ext.assignmapper import assign_mapper 7 8 from owner import Owner 7 9 8 10 __all__ = ['meta', … … 131 133 return "<Autoinstall %s: %s (%s)>" % (self.autoinstall_id, self.description, self.type.type_id) 132 134 133 from owner import Owner134 135 135 session.mapper(Machine, machine_table, 136 136 properties={'nics': relation(NIC, backref="machine"), -
trunk/packages/invirt-database/python/database/owner.py
r2134 r2135 10 10 return """<Owner %s: ram_quota_total=%s MB ram_quota_single=%s MB 11 11 disk_quota_total=%s MB disk_quota_single=%s MB 12 vms_quota_total=%s vms_quota_active=%s >""" % (self.owner_id, self.ram_quota_total, self.ram_quota_single, self.disk_quota_total, self.disk_quota_single, self.vms_quota_total, self.vms_quota_active) 12 vms_quota_total=%s vms_quota_active=%s >""" % (self.owner_id, 13 self.ram_quota_total if self.ram_quota_total else MAX_MEMORY_TOTAL, 14 self.ram_quota_single if self.ram_quota_single else MAX_MEMORY_SINGLE, 15 self.disk_quota_total if self.disk_quota_total else MAX_DISK_TOTAL, 16 self.disk_quota_single if self.disk_quota_single else MAX_DISK_SINGLE, 17 self.vms_quota_total if self.vms_quota_total else MAX_VMS_TOTAL, 18 self.vms_quota_active if self.vms_quota_active else MAX_VMS_ACTIVE) 13 19 def getMemoryQuotas(owner): 14 20 owner_info = Owner.query().filter_by(owner_id=owner).first()
Note: See TracChangeset
for help on using the changeset viewer.