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

Cannot use SQLAlchemy models: "Object of type XYZ is not JSON serializable" #52

Open
kemaleren opened this issue May 25, 2022 · 1 comment

Comments

@kemaleren
Copy link

kemaleren commented May 25, 2022

I cannot recreate the search example on https://www.flask-meld.dev/ which shows the function users() running a query and returning the results. Then the template directly uses those objects, such as in <h3>{{ user.name }}</h3>.

When I try to recreate that pattern, I get an exception: TypeError: Object of type XYZ is not JSON serializable, related to line 259 in componenty.py.

I was hoping that since the templates were rendered on the server, I would not need to write a serializer for my models. Is that not correct?

@israel-oye
Copy link

I think it's a dependency issue. Flask-SQLALchemy-3.0.2 (the latest version as at now) is not compatible with the version of Flask that supports Flask-Meld. See Issue #53

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

2 participants