Commit e7b439e7 authored by Nicolas Dumazet's avatar Nicolas Dumazet

Pass dictionaries instead of tuples to indexing methods


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33321 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 12e67125
......@@ -217,7 +217,9 @@ class Measure(XMLMatrix):
management_unit_quantity = getQuantity(management_unit_value)
if (not default or quantity == management_unit_quantity):
return (uid, resource_uid, '^', metric_type_uid, quantity),
return (dict(uid=uid, resource_uid=resource_uid,
variation='^', metric_type_uid=metric_type_uid,
quantity=quantity)),
return ()
if default:
......@@ -302,10 +304,10 @@ class Measure(XMLMatrix):
if quantity is None:
continue
cell = quantity
row_list.append((uid,
resource_uid,
'^%s$' % ''.join(regex_list),
metric_type_uid,
cell * quantity_unit))
row_list.append(dict(uid=uid,
resource_uid=resource_uid,
variation='^%s$' % ''.join(regex_list),
metric_type_uid=metric_type_uid,
quantity=cell * quantity_unit))
return row_list
......@@ -967,7 +967,10 @@ class Resource(XMLMatrix, Variated):
row_list = []
for unit_uid, value in self._getQuantityUnitDefinitionDict().iteritems():
definition_uid, quantity = value
row_list.append((definition_uid, uid, unit_uid, quantity))
row_list.append(dict(uid=definition_uid,
resource_uid=uid,
quantity_unit_uid=unit_uid,
quantity=quantity))
return row_list
......@@ -1062,7 +1065,9 @@ class Resource(XMLMatrix, Variated):
.getCategoryUid(metric_type, 'metric_type')
if quantity and metric_type_uid:
uid = self.getUid()
insert_list += (uid, uid, '^', metric_type_uid, float(quantity)),
insert_list.append(dict(uid=uid, resource_uid=uid, variation='^',
metric_type_uid=metric_type_uid,
quantity=float(quantity)))
return insert_list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment