From: Thomas D. <svn...@pl...> - 2008-09-27 14:18:09
|
Author: thomasdesvenain Date: Sat Sep 27 14:18:04 2008 New Revision: 10080 Modified: MoreFieldsAndWidgets/CompoundField/trunk/Products/CompoundField/validators.py Log: (coding style) using different vars for field and subfield Modified: MoreFieldsAndWidgets/CompoundField/trunk/Products/CompoundField/validators.py ============================================================================== --- MoreFieldsAndWidgets/CompoundField/trunk/Products/CompoundField/validators.py (original) +++ MoreFieldsAndWidgets/CompoundField/trunk/Products/CompoundField/validators.py Sat Sep 27 14:18:04 2008 @@ -35,15 +35,15 @@ *args, **kwargs): form = REQUEST and REQUEST.form or None - for field in self._getSubfields(field, form): + for subfield in self._getSubfields(field, form): result = None if form: - widget = field.widget - result = widget.process_form(instance, field, form, + widget = subfield.widget + result = widget.process_form(instance, subfield, form, empty_marker=_marker) if result is None or result is _marker: - accessor = field.getEditAccessor(instance) or \ - field.getAccessor(instance) + accessor = subfield.getEditAccessor(instance) or \ + subfield.getAccessor(instance) if accessor is not None: value = accessor() else: @@ -52,12 +52,12 @@ else: value = result[0] - res = field.validate(instance=instance, - value=value, - errors=errors, - REQUEST=REQUEST) + res = subfield.validate(instance=instance, + value=value, + errors=errors, + REQUEST=REQUEST) if res: - errors[field.getName()] = res + errors[subfield.getName()] = res return errors |