Пример #1
0
 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
Пример #2
0
 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
Пример #3
0
 def __init__(self, field, name, value, all_errors):
     Widget.__init__(self, field, name, _force_dict(value), all_errors)
     self._subwidgets = {}