miguelgrinberg / microblog-api

A modern (as of 2024) Flask API back end.
MIT License
365 stars 100 forks source link

Is marshmallow_sqlalchemy package needed? #28

Closed Vathys closed 8 months ago

Vathys commented 8 months ago

Hello,

Thank you for all you tutorials! They have been extremely helpful in learning about Flask and React, and web development in general. I'm attempting to understand the api, and was confused with marshmallow. I was exposed to this only on examination of this api, since you haven't yet used this in your Flask Mega-Tutorial. While I think I understand how marshmallow is working, I'm confused on where this specific package is used? When I examined the generated pip-compile requirements, marshmallow_sqlalchemy is not a dependency for any other package. Furthermore, most of the features used in this package are already implemented in flask-marshmallow, which you already use.

I think I'm getting confused with all the integrations that are happening with sqlalchemy, flask, etc. Please let me know if I am missing something?

Thank you

miguelgrinberg commented 8 months ago

This project uses the SQLAlchemySchema class, which comes from the marshmallow-sqlalchemy package. There isn't a direct dependency, but Flask-Marshmallow will only expose a SQLAlchemySchema when this package is installed.

Vathys commented 8 months ago

Thank you for the reply!