Improve Record.get by using directly a dict

This commit is contained in:
Cédric Krier committed 2012-12-05 15:17:33 +01:00
1 parent 25da76dbba
commit 34e4ecc896
1 file changed
+3 -4
+3 -4
View File
@@ -222,7 +222,7 @@ class Record(SignalEvent):
get_modifiedonly=False):
if check_load:
self._check_load()
value = []
value = {}
for name, field in self.group.fields.iteritems():
if field.attrs.get('readonly'):
continue
@@ -232,9 +232,8 @@ class Record(SignalEvent):
if (field.name not in self.modified_fields
and get_modifiedonly):
continue
value.append((name, field.get(self, check_load=check_load,
readonly=get_readonly, modified=get_modifiedonly)))
value = dict(value)
value[name] = field.get(self, check_load=check_load,
readonly=get_readonly, modified=get_modifiedonly)
if includeid:
value['id'] = self.id
return value