def convert(self, value): value = _force_dict(value) errors = {} result = {} for name, field in self.fields.iteritems(): try: result[name] = field(value.get(name)) except ValidationError, e: errors[name] = e
def to_primitive(self, value): value = _force_dict(value) result = {} for key, field in self.fields.iteritems(): result[key] = field.to_primitive(value.get(key)) return result
def __init__(self, field, name, value, all_errors): Widget.__init__(self, field, name, _force_dict(value), all_errors) self._subwidgets = {}