Changeset 2213 for trunk/packages/invirt-database/python/database/owner.py
- Timestamp:
- Feb 27, 2009, 2:18:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-database/python/database/owner.py
r2200 r2213 1 1 from invirt.database import record 2 from invirt.database.models import session 2 3 3 4 class Owner(record.Record): … … 18 19 @classmethod 19 20 def getMemoryQuotas(cls, owner): 20 owner_info = cls.query(). filter_by(owner_id=owner).first()21 owner_info = cls.query().get(owner) 21 22 if owner_info == None: 22 23 owner_info = cls(owner_id=owner) 24 session.expunge(owner_info) 23 25 return (owner_info.get('ram_quota_total'), owner_info.get('ram_quota_single')) 24 26 25 27 @classmethod 26 28 def getDiskQuotas(cls, owner): 27 owner_info = cls.query(). filter_by(owner_id=owner).first()29 owner_info = cls.query().get(owner) 28 30 if owner_info == None: 29 31 owner_info = cls(owner_id=owner) 32 session.expunge(owner_info) 30 33 return (owner_info.get('disk_quota_total'), owner_info.get('disk_quota_single')) 31 34 32 35 @classmethod 33 36 def getVMQuotas(cls, owner): 34 owner_info = cls.query(). filter_by(owner_id=owner).first()37 owner_info = cls.query().get(owner) 35 38 if owner_info == None: 36 39 owner_info = cls(owner_id=owner) 40 session.expunge(owner_info) 37 41 return (owner_info.get('vms_quota_total'), owner_info.get('vms_quota_active'))
Note: See TracChangeset
for help on using the changeset viewer.