Beispiel #1
0
 def conv_List(self, model, field, kwargs):
     if isinstance(field.field, ReferenceField):
         return ModelSelectMultipleField(model=field.field.document_type, **kwargs)
     if field.field.choices:
         kwargs['multiple'] = True
         return self.convert(model, field.field, kwargs)
     unbound_field = self.convert(model, field.field, {})
     kwargs = {
         'validators': [],
         'filters': [],
     }
     return f.FieldList(unbound_field, min_entries=0, **kwargs)
Beispiel #2
0
 def conv_List(self, model, field, kwargs):
     if isinstance(field.field, ReferenceField):
         return ModelSelectMultipleField(model=field.field.document_type, **kwargs)
     if field.field.choices:
         kwargs['multiple'] = True
         return self.convert(model, field.field, kwargs)
     field_args = kwargs.pop("field_args", {})
     unbound_field = self.convert(model, field.field, field_args)
     unacceptable = {
         'validators': [],
         'filters': [],
         'min_entries': kwargs.get('min_entries', 0)
     }
     kwargs.update(unacceptable)
     return f.FieldList(unbound_field, **kwargs)