Converting Flask-SQLAlchemy to JSON With Flask-Marshmallow

preview_player
Показать описание
This video demonstrates how to use Flask-Marshmallow to return JSON representations of Flask-SQLAlchemy models.

WORK WITH ME👇🏼

✅ Implement features and fix bugs in your app: Live, one-on-one screenshare

💻 Code written in video
Рекомендации по теме
Комментарии
Автор

It's worth noting that at this moment when you google solutions to "how to serialize sql alchemy query results" on stack overflow not a single person suggested in any of the posts that a solution like this exists already - all the ones I read have you making custom serializers.

maddevskilz
Автор

THIS IS THE BEST CHANNEL EVER, thank you sir! please keep up

mounirdev
Автор

High quality (content) videos. Thank you!

Randomisticful
Автор

Hi. there. My name is Randy. I really appreciate your efforts in delivering all those high quality tutorials, I benefit from it a lot. I'd would really want other people in China to know your channel too. Unfortunately, the GFW blocks us from visiting website like Youtube, Facebook, twtiter, etc. With your permission, I would really like to share your videos and translate them into Chinese then put them on a Chinese Website. If, by any chance, you don't mind, please let me know.

randixlai
Автор

Hey, this is great. I've been collecting and returning the data to the user manually after db query. Thank you !!

leustad
Автор

ma.ModelSchema has been dropped from the Marshmallow-SQLAlchemy module. if you have time an updated video would be awesome!

imblocker
Автор

Excellent tutorial, good explanations, and straight to the point!

stefmyt
Автор

if you have ever played around with api-spec that package makes it even easier. just use the normal marshal_with decorator and pass the marshmallow schema in. done. no need to dump

BryceJohnson
Автор

ror running WSGI application
2021-04-03 10:23:19, 173: AttributeError: 'dict' object has no attribute 'data'

such a nice film and it just does not work because things change too fast

sofiamouchard
Автор

Thanks a lot ..!
It helped me ..
But I want rewards names instead of 1 and 2 in JSON ..
What can I do for it ..?
Please make a video on showing actual names of rewards names instead of 1 and 2.
Waiting for your response.

hasanmohiuddinahmed
Автор

7:55 ma.modelschema nolonger available . giving error 'Marshmallow' object has no attribute 'ModelSchema'. need to use ma.SQLAlchemyAutoSchema

susantamahakud
Автор

For those who receive an error; It seems ma.ModelSchema and ma.TableSchema are deprecated and are not shipped with newer versions. Instead, do this:

from marshmallow_sqlalchemy import SQLAlchemyAutoSchema

class


class Meta:
model = User

finalfantasy
Автор

Hi Anthony, I have a problem with my schema when the I have a NULL date in my database. It is recognized as a string for SQLAlchemy "0000-00-00" so the marshmallow fails to apply some datetime methods on the string. How to work around this issue?

thombou
Автор

This, my friend, is pure gold. Thank you a lot! You just cured my headache xD Best regards from Germany :D

MultiSegelflieger
Автор

one more question: how, if possible, can one pass the rewards objects also to the JSON, and not merely their ids?

vaneakatok
Автор

You did really great . Your Teaching Way.Wow Wow

Shoaib_ihsan
Автор

Good stuff. I have a query. Can we auto generate marshmallow model code for the db models? I used declarative map and created model classes automatically by using some library

MrLokeshbly
Автор

Hai... Anthony could u please make a video about new version flask-marshmallow here or your udemy course?

mystackquest
Автор

why do you instanced the user_schema in the index() function and not right after the class UserSchema() ?

naheliegend
Автор

what about converting them back to SQLalchemy instances?

WaldoTheWombat