mirror of
https://github.com/fastapi/full-stack-fastapi-template.git
synced 2026-11-03 20:36:27 +00:00
⬆ Upgrade code to support pydantic V2 (#615)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
# Shared properties
|
||||
@@ -22,9 +22,7 @@ class ItemInDBBase(ItemBase):
|
||||
id: int
|
||||
title: str
|
||||
owner_id: int
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
# Properties to return to client
|
||||
|
||||
Reference in New Issue
Block a user