diff options
Diffstat (limited to 'widgets.py')
-rw-r--r-- | widgets.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/widgets.py b/widgets.py new file mode 100644 index 0000000..77f3650 --- /dev/null +++ b/widgets.py @@ -0,0 +1,12 @@ +import wtforms.widgets.core + + +class TextArea(wtforms.widgets.core.TextArea): + def __init__(self, **kwargs): + self.kwargs = kwargs + + def __call__(self, field, **kwargs): + for arg in self.kwargs: + if arg not in kwargs: + kwargs[arg] = self.kwargs[arg] + return super(TextArea, self).__call__(field, **kwargs) |