tortoise / tortoise-orm

Familiar asyncio ORM for python, built with relations in mind
https://tortoise.github.io
Apache License 2.0
4.39k stars 359 forks source link

docs: update pydantic docs accordingly Pydantic V2 #1469

Closed plusiv closed 10 months ago

plusiv commented 10 months ago

Updated the Pydantic Serialization Tutorial documentation accordingly to the new API by replacing the .dict() and .json() by the new ones. Additionally changed __root__ attribute by root from the new RootModel.

Description

Methods .json() and .dict were deprecated in the new Pydantic V2 API, this changes aims to change the related pydantic documentation regarding Pydantic Serialization Tutorial to the new methods.

New methods replacements are:

See migration guide.

Regarding the __root__ field, since they decoupled the "custom root model" with the new type RootModel, that usage was changed in documentation as well.

Motivation and Context

Pydantic Migration Guide

How Has This Been Tested?

N/A

Checklist:

long2ice commented 10 months ago

Thanks!