From 40f41f6d76d90ef96e57a821c253025402f790dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Hakl?= Date: Sat, 6 Jun 2015 18:48:40 +0200 Subject: [PATCH] Make RangeInput inherit from NumberInput Otherwise min and max attributes are not set according to validators. --- wtforms_components/widgets.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/wtforms_components/widgets.py b/wtforms_components/widgets.py index 8db6d4f..466a79f 100644 --- a/wtforms_components/widgets.py +++ b/wtforms_components/widgets.py @@ -127,13 +127,6 @@ class WeekInput(HTML5Input): input_type = 'week' -class RangeInput(HTML5Input): - """ - Renders an input with type "range". - """ - input_type = 'range' - - class URLInput(HTML5Input): """ Renders an input with type "url". @@ -220,6 +213,12 @@ class NumberInput(HTML5Input): def range_validators(self, field): return min_max(field, self.range_validator_class) +class RangeInput(NumberInput): + """ + Renders an input with type "range". + """ + input_type = 'range' + class ReadOnlyWidgetProxy(object): def __init__(self, widget):