Add model_config to SQLModelSerializable
This commit is contained in:
parent
0fa85687f1
commit
367eadd6e2
1 changed files with 2 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
import orjson
|
import orjson
|
||||||
|
from pydantic import ConfigDict
|
||||||
from sqlmodel import SQLModel
|
from sqlmodel import SQLModel
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -19,7 +20,4 @@ def orjson_dumps(v, *, default=None, sort_keys=False, indent_2=True):
|
||||||
|
|
||||||
|
|
||||||
class SQLModelSerializable(SQLModel):
|
class SQLModelSerializable(SQLModel):
|
||||||
class Config:
|
model_config = ConfigDict(from_attributes=True)
|
||||||
orm_mode = True
|
|
||||||
json_loads = orjson.loads
|
|
||||||
json_dumps = orjson_dumps
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue