emmett-framework / emmett

The web framework for inventors
BSD 3-Clause "New" or "Revised" License
1.06k stars 71 forks source link

Missing form widget for field type decimal #200

Closed josejachuf closed 7 years ago

josejachuf commented 7 years ago

RuntimeError: Missing form widget for field my_field of type decimal(18,4) I tried with this:

@staticmethod
def widget_decimal(attr, field, value, _class='float', _id=None):
    return FormStyle.widget_string(attr, field, value, _class, _id)

But expects the name of the property to be "widget_decimal(18,4)"

Also with this:

   form_widgets = {
        'my_field': FormStyle.widget_float
    }

TypeError: widget_float() missing 1 required positional argument: 'value'

gi0baro commented 7 years ago

@josejachuf yup this is a bug. I should patch the FormStyle class. Will keep you updated on this.

josejachuf commented 7 years ago

For now I solved it with a custom widget. Thanks