Revision 9b126f13 snf-astakos-app/astakos/quotaholder/callpoint.py
b/snf-astakos-app/astakos/quotaholder/callpoint.py | ||
---|---|---|
106 | 106 |
'quantity': quantity, |
107 | 107 |
} |
108 | 108 |
|
109 |
def set_holder_quota(self, quotas): |
|
110 |
q = self._level_quota_dict(quotas) |
|
111 |
self.set_quota(q) |
|
112 |
|
|
113 |
def _level_quota_dict(self, quotas): |
|
114 |
lst = [] |
|
115 |
for holder, holder_quota in quotas.iteritems(): |
|
116 |
for source, source_quota in holder_quota.iteritems(): |
|
117 |
for resource, limit in source_quota.iteritems(): |
|
118 |
key = (holder, source, resource) |
|
119 |
lst.append((key, limit)) |
|
120 |
return lst |
|
121 |
|
|
122 | 109 |
def set_quota(self, quotas): |
123 | 110 |
holding_keys = [key for (key, limit) in quotas] |
124 | 111 |
holdings = self._get_holdings_for_update(holding_keys) |
Also available in: Unified diff