Commit bff1f960 authored by Sebastian Kalinowski's avatar Sebastian Kalinowski

New ARRAY type for sqlalchemy

In 1.1.0 [1] SqlAlchemy changed base type for ARRAY type.
This is causing flask-admin to skip ARRAY fields due to unknown type.
Now, the base type for ARRAY type is sqlalchemy.sql.sqltypes.ARRAY

See: http://docs.sqlalchemy.org/en/latest/changelog/changelog_11.html#change-1.1.0b1-sql
parent 4fe58804
......@@ -343,7 +343,8 @@ class AdminModelConverter(ModelConverterBase):
field_args['validators'].append(validators.UUID())
return fields.StringField(**field_args)
@converts('sqlalchemy.dialects.postgresql.base.ARRAY')
@converts('sqlalchemy.dialects.postgresql.base.ARRAY',
'sqlalchemy.sql.sqltypes.ARRAY')
def conv_ARRAY(self, field_args, **extra):
return form.Select2TagsField(save_as_list=True, **field_args)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment