New to RestX - Any example on database tables?
Please provide examples on connecting to DATBASE TABLES - New to Flask-RestX
I recommend using Flask-SQLAlchemy. You can check out my boilerplate as an example for this.
Usually you use Flask libraries and most of the resources available for Flask should work fine for your app to extend its functionalities.
flask-restx does not provide models or for interacting with databases. the models are for creating OpenApi specs and for validation and marshalling of payloads (from a POST or PUT).
For DB interactions, there are many libraries, ranging from stringy and direct (psycopg2) to full ORMs Some ORMs to consider
documentation label added for us to update our docs to state flask-restx doesn't offer an ORM, and to give links to options
Hi, is there a way to create flask_restx.api.model directly MarshmallowSqlalchemyAutoSchema? I tried registering a model by model = api.model("SomeModel", SomeSchema.fields) but it did not work because there were string values.
edit I tried JSONSchema and schema_model but the swagger response example model does not have any attributes!
Hi, is there a way to create flask_restx.api.model directly MarshmallowSqlalchemyAutoSchema? I tried registering a model by model = api.model("SomeModel", SomeSchema.fields) but it did not work because there were string values.
edit I tried JSONSchema and schema_model but the swagger response example model does not have any attributes!
Any updates on whether you managed to get flask_restx to work with flask-marshmallow? I have the exact same use-case and there doesn't seem to be any documentation about it.