librelist archives

« back to archive

Declarative enum (SQLAlchemy) with WTForms

Declarative enum (SQLAlchemy) with WTForms

Dries De Smet
2014-12-18 @ 17:26

Has anyone used the Declarative enum  ( together with

 I can get the select field to show the values, but whenever I'm trying to
submit (flask-admin), it says it's not a valid choice. I've tried setting
the value to just the key of the enum, which fails because the bind
parameters of the column tries to find a value.value, and also setting it
MyEnum.from_string(key), but that fails as well.

Quite a specific question, but not sure where to ask it..!

Kind regards,