Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

widgets.BaseDateTimeInput fails if min or max is a callable #24

Open
cocosx opened this issue Nov 23, 2014 · 0 comments
Open

widgets.BaseDateTimeInput fails if min or max is a callable #24

cocosx opened this issue Nov 23, 2014 · 0 comments

Comments

@cocosx
Copy link

cocosx commented Nov 23, 2014

  File ".../venv/lib/python2.7/site-packages/wtforms/fields/core.py", line 149, in __call__
    return self.meta.render_field(self, kwargs)
  File ".../venv/lib/python2.7/site-packages/wtforms/meta.py", line 53, in render_field
    return field.widget(field, **render_kw)
  File ".../venv/lib/python2.7/site-packages/wtforms_components/widgets.py", line 74, in __call__
    for key, value in self.range_validators(field).items():
  File ".../venv/lib/python2.7/site-packages/wtforms_components/widgets.py", line 99, in range_validators
    data['min'] = data['min'].strftime(self.format)
AttributeError: 'function' object has no attribute 'strftime'

Probably should be handeled similarly to validators.BaseDateTimeRange.__call__
As a workaround, I do

from wtforms_components.widgets import BaseDateTimeInput
BaseDateTimeInput.range_validator_class = int #any random class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant