equal
deleted
inserted
replaced
458 constraints = rschema.rproperty(eschema, targetschema, 'constraints') |
458 constraints = rschema.rproperty(eschema, targetschema, 'constraints') |
459 # init StringField parameters according to constraints |
459 # init StringField parameters according to constraints |
460 for cstr in constraints: |
460 for cstr in constraints: |
461 if isinstance(cstr, StaticVocabularyConstraint): |
461 if isinstance(cstr, StaticVocabularyConstraint): |
462 kwargs.setdefault('widget', Select()) |
462 kwargs.setdefault('widget', Select()) |
|
463 kwargs.setdefault('choices', cstr.vocabulary) |
463 if card in '?1': |
464 if card in '?1': |
464 kwargs['widget'].attrs.setdefault('size', 1) |
465 kwargs['widget'].attrs.setdefault('size', 1) |
465 if isinstance(cstr, SizeConstraint) and cstr.max is not None: |
466 if isinstance(cstr, SizeConstraint) and cstr.max is not None: |
466 if cstr.max > 257: |
467 if cstr.max > 257: |
467 kwargs.setdefault('widget', TextArea) |
468 kwargs.setdefault('widget', TextArea) |