# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1242152299 -7200 # Node ID d46f59e5efd356f77d9cf92923bf395ade0f9202 # Parent fbb9928bf4f13b9f7b4901b7fcccd8ef3f104f37 some widget adjustments diff -r fbb9928bf4f1 -r d46f59e5efd3 web/formfields.py --- a/web/formfields.py Tue May 12 20:17:49 2009 +0200 +++ b/web/formfields.py Tue May 12 20:18:19 2009 +0200 @@ -334,6 +334,9 @@ super(IntField, self).__init__(**kwargs) self.min = min self.max = max + if isinstance(self.widget, TextInput): + self.widget.attrs.setdefault('size', 5) + self.widget.attrs.setdefault('maxlength', 15) class BooleanField(Field): widget = Radio @@ -372,7 +375,7 @@ class TimeField(DateField): format_prop = 'ui.datetime-format' - widget = TextInput + widget = TextInput class HiddenInitialValueField(Field): def __init__(self, visible_field): @@ -384,6 +387,7 @@ class RelationField(Field): def __init__(self, **kwargs): + kwargs.setdefault('sort', False) super(RelationField, self).__init__(**kwargs) @staticmethod