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

My priority is to help build a production-ready application using FastAPI

I prioritize quality over simplicity. Our challenging approach ensures you're prepared for real-world development.

Contacts

Refunds:

Refund Policy
Social

Follow us on our social media channels to stay updated with our latest tutorials and resources.

© Copyright 2022-2025 Team FastAPITutorial. All rights reserved.