cubicweb/web/formfields.py
branch3.26
changeset 12347 cb05926a99d0
parent 11929 fcbd6b251d81
child 12348 6bcdd7278f7f
equal deleted inserted replaced
12344:34c7c656022f 12347:cb05926a99d0
  1265                     break
  1265                     break
  1266             for cstr in rdef.constraints:
  1266             for cstr in rdef.constraints:
  1267                 if isinstance(cstr, SizeConstraint) and cstr.max is not None:
  1267                 if isinstance(cstr, SizeConstraint) and cstr.max is not None:
  1268                     kwargs['max_length'] = cstr.max
  1268                     kwargs['max_length'] = cstr.max
  1269         return fieldclass(**kwargs)
  1269         return fieldclass(**kwargs)
  1270     return RelationField.fromcardinality(card, **kwargs)
  1270     else:
       
  1271         fieldclass = kwargs.pop('fieldclass', RelationField)
       
  1272         return fieldclass.fromcardinality(card, **kwargs)
  1271 
  1273 
  1272 
  1274 
  1273 FIELDS = {
  1275 FIELDS = {
  1274     'String' :  StringField,
  1276     'String' :  StringField,
  1275     'Bytes':    FileField,
  1277     'Bytes':    FileField,