Use of orm_mode in Pydantic


Hi Sourabh,

I do have another question for you. I'd like you to shed light on the usage of attribute orm_mode=True within sublass Config of class ShowBlog . Leaving aside the fact that Pydantic v2 has discarded orm_mode in favour of something else, my question is, why do we have to set it considering that in the codebase we are never explicitly transforming SQLAlchemy objects into Pydantic objects?

Indeed, my understanding is that it is needed to provide such transformation given that FastAPI is designed to work with Pydantic objects.

 

Thank you,

Alessandro

FastAPITutorial

Brige the gap between Tutorial hell and Industry. We want to bring in the culture of Clean Code, Test Driven Development.

We know, we might make it hard for you but definitely worth the efforts.

Contacts

Refunds:

Refund Policy
Social

Follow us on our social media channels to stay updated.

© Copyright 2022-23 Team FastAPITutorial