Add grouped calls to on_change_with

review251001
This commit is contained in:
Cédric Krier
2012-03-05 23:39:58 +01:00
parent af6e212aa5
commit 6e88e99aae
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -1,3 +1,4 @@
* Add group call to on_change_with
* Allow to get fuzzy translation
* Allow to customize server timezone
* Add richtext widget for WYSIWYG editor
+8
View File
@@ -71,6 +71,7 @@ class Model(WarningErrorMixin, URLMixin):
self._rpc = {
'default_get': False,
'fields_get': False,
'on_change_with': False,
}
self._inherit_fields = []
self._error_messages = {}
@@ -616,3 +617,10 @@ class Model(WarningErrorMixin, URLMixin):
if i not in fields_names:
del res[i]
return res
def on_change_with(self, fieldnames, values):
changes = {}
for fieldname in fieldnames:
changes[fieldname] = getattr(self,
'on_change_with_%s' % fieldname)(values)
return changes