Skip to content
Browse files

Consider ``maxlength`` in ``input_attributes_common``

  • Loading branch information...
1 parent b5a6df8 commit 5d45feffb557cfbddc238fcca1ec0ddc7a3666dc @rnixx rnixx committed
Showing with 15 additions and 2 deletions.
  1. +6 −0 HISTORY.rst
  2. +1 −1 setup.py
  3. +8 −1 src/yafowil/common.py
View
6 HISTORY.rst
@@ -2,6 +2,12 @@
History
=======
+2.0.2dev
+--------
+
+- Consider ``maxlength`` in ``input_attributes_common``.
+ [rnix, 2012-11-03]
+
2.0.1
-----
View
2 setup.py
@@ -5,7 +5,7 @@
)
-version = '2.0.1'
+version = '2.0.2dev'
shortdesc = \
'YAFOWIL - declarative, flexible html forms, framework independent.'
longdesc = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
View
9 src/yafowil/common.py
@@ -87,6 +87,11 @@
"""Allowed input size.
"""
+factory.defaults['maxlength'] = None
+factory.doc['props']['maxlength'] = \
+"""Input maxlength.
+"""
+
factory.defaults['disabled'] = None
factory.doc['props']['disabled'] = \
"""Disables input.
@@ -112,7 +117,8 @@
factory.defaults['display_proxy'] = False
factory.doc['props']['display_proxy'] = """\
-If 'True' and widget mode 'display', widget value gets rendered as hidden input.
+If 'True' and widget mode 'display', widget value gets rendered as hidden
+input.
"""
@@ -172,6 +178,7 @@ def input_attributes_common(widget, data, excludes=list(), value=None):
'placeholder': attr_value('placeholder', widget, data),
'required': required,
'size': attr_value('size', widget, data),
+ 'maxlength': attr_value('maxlength', widget, data),
'title': attr_value('title', widget, data),
'type': attr_value('type', widget, data),
'value': value,

0 comments on commit 5d45fef

Please sign in to comment.
Something went wrong with that request. Please try again.