Removed field type 'number'.

pull/7/head
Ferry Boender 10 years ago
parent 57de1bd900
commit 0b9f093a9d
  1. 12
      src/formrender.py
  2. 2
      src/webapp.py

@ -36,9 +36,6 @@ class FormRender(object):
u'value="{value}" size="{size}" ' u'value="{value}" size="{size}" '
u'class="{classes}" style="{style}" minlength="{minlen}" ' u'class="{classes}" style="{style}" minlength="{minlen}" '
u' maxlength="{maxlen}" />', u' maxlength="{maxlen}" />',
"number": u'<input {required} type="number" min="{minval}" '
u'max="{maxval}" step="any" name="{name}" '
u'value="{value}" class="{classes}" style="{style}" />',
"integer": u'<input {required} type="number" min="{minval}" ' "integer": u'<input {required} type="number" min="{minval}" '
u'max="{maxval}" name="{name}" value="{value}" ' u'max="{maxval}" name="{name}" value="{value}" '
u'class="{classes}" style="{style}" />', u'class="{classes}" style="{style}" />',
@ -117,15 +114,6 @@ class FormRender(object):
size=size, required=required, classes=classes, size=size, required=required, classes=classes,
style=style) style=style)
def r_field_number(self, name, value, minval=None, maxval=None,
required=False, classes='', style=""):
"""
Render a number field to HTML.
"""
tpl = self.field_tpl['number']
return tpl.format(name=name, value=value, minval=minval, maxval=maxval,
required=required, classes=classes, style=style)
def r_field_integer(self, name, value, minval=None, maxval=None, def r_field_integer(self, name, value, minval=None, maxval=None,
required=False, classes='', style=""): required=False, classes='', style=""):
""" """

@ -383,7 +383,7 @@ class ScriptFormWebApp(WebAppHandler):
if field['type'] in ('string', 'text'): if field['type'] in ('string', 'text'):
params['maxlen'] = field.get('maxlen', '') params['maxlen'] = field.get('maxlen', '')
if field['type'] in ('number', 'integer', 'float'): if field['type'] in ('integer', 'float'):
params['minval'] = field.get("min", '') params['minval'] = field.get("min", '')
params['maxval'] = field.get("max", '') params['maxval'] = field.get("max", '')

Loading…
Cancel
Save