# HG changeset patch # User Aurelien Campeas # Date 1242297083 -7200 # Node ID abf40bcb5967876f18dc7e9e183ed95d37be4780 # Parent d628defebc171e95821b7e0c7e50d4977affe04d let the StringField have a default TextArea widget, only TextInput on small size constraint & no static vocabulary diff -r d628defebc17 -r abf40bcb5967 web/formfields.py --- a/web/formfields.py Thu May 14 11:38:40 2009 +0200 +++ b/web/formfields.py Thu May 14 12:31:23 2009 +0200 @@ -473,9 +473,10 @@ if card in '?1': kwargs['widget'].attrs.setdefault('size', 1) if isinstance(cstr, SizeConstraint) and cstr.max is not None: - if cstr.max > 257: - kwargs.setdefault('widget', TextArea) + if cstr.max < 257: + kwargs.setdefault('widget', TextInput()) kwargs['max_length'] = cstr.max + kwargs.setdefault('widget', TextArea()) return StringField(**kwargs) if fieldclass is FileField: for metadata in ('format', 'encoding'):