I have a SQLAlchemy model with custom type ChoiceType which comes from sqlalchemy_utils
library.
class Recipient(Base, BaseMixin):
first_name = Column(String())
last_name = Column(String())
social_network = Column(ChoiceType(SOCIAL_NETWOKRS))
Where SOCIAL_NETWOKRS are SOCIAL_NETWOKRS = [
('vk', 'Vkontakte'),
('fb', 'Facebook'),
('youtube', 'Youtube'),
]
I got next error when going into admin panel for edit my model:
NotImplementedError: Not able to derive a colander type from sqlalchemy type: ChoiceType(length=255) Please explicitly provide a colander `typ` for the "social_network" Column.
How can I get around the restriction with saving autogeneration of the administrative panel?
I move from
sqlalchemy_utils
and add direct validation from a Colander.Next snippet works as expected: