Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Related(column=...) with non-standard column types #478

Open
AbdealiLoKo opened this issue Jan 13, 2023 · 0 comments
Open

Using Related(column=...) with non-standard column types #478

AbdealiLoKo opened this issue Jan 13, 2023 · 0 comments

Comments

@AbdealiLoKo
Copy link
Collaborator

AbdealiLoKo commented Jan 13, 2023

I have a model which uses EnumType from sqlalchemy called category.
When I try to dump some information in my schema with Related(column='category')
It throws an error that Enum cannot be serialized to JSON

Is there a way for me to let ma-sqla know that this field should be dumped using a field I have created called EnumField which handles the serialization and deserialization logic ?

I guess Related is currently assuming it can take the value from the DB directly. So, maybe we need a Related(column='category', column_field=EnumField) or something which is used to serialize/deserialize the value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant