Integer array field in postgress is not handled by flask admin properly
See original GitHub issueInteger array field in my table in postgres exists and work perfectly. I can create/apdate/insert/delete it with numbers.
Flask-admin sees and interprets that field by SQLAlchemy model. Field shows up with its content in edit form in flask-admin.
But whenever I try to save the form (regardless of editing or leaving contents of array field as is) I got error 500. Postgres throws an error:
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) column "courses_ids" is of type integer[] but expression is of type text[]
So it seems that flask-admin interprets my int array field as text array.
Is there any solution on how to instruct Flask-Admin that the array field is of type int ?
Sqlalchemy field declaration: courses_ids = Column(ARRAY(Integer))
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:6
A workaround:
what is the Select2TagsField Class you’re inheriting from?