emmett-framework / emmett

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

Form validation: dropdowns not generated, only value verified #62

Closed GiantCrocodile closed 8 years ago

GiantCrocodile commented 8 years ago

If I create a model and define an int field with validation =

...
        "country_id": {
                        "presence": True,
                        'in': {'set': [0, 1], 'labels': ['Germany', 'Other']}
                      },
...

I would expect my dropdown menu to be displayed on registration. But it only shows a textfield where the input is only allowed to be 0 or 1. Any other value is denied. When I register with 0 or 1 and see at my profile I see that the value of country_id is "value".

Why is there no dropdown and why is country_id "value" and not 0 or 1 in my profile? If I look at my db, there is 1 or 0 stored, not "value" or nothing.

This is related to http://weppy.org/docs/0.5/validations#value-inclusion

gi0baro commented 8 years ago

@GiantCrocodile I will inspect this in the next hours.

gi0baro commented 8 years ago

@GiantCrocodile this is fixed on master and v0.5.3 release

GiantCrocodile commented 8 years ago

Thanks @gi0baro. I really appreciate your work and fast support!