mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-12-27 11:49:04 +00:00
🐛 Fix pydantic basemodel v2 default config
This commit is contained in:
parent
e2d5b7ee70
commit
67d7ea226b
@ -2,8 +2,7 @@ from datetime import datetime
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Dict, List, Any, Optional
|
from typing import Dict, List, Any, Optional
|
||||||
|
|
||||||
from pydantic import Field
|
from pydantic import BaseModel, Field
|
||||||
from simnet.models.base import APIModel as BaseModel
|
|
||||||
|
|
||||||
|
|
||||||
class AkashaSubStat(str, Enum):
|
class AkashaSubStat(str, Enum):
|
||||||
|
@ -2,9 +2,9 @@ import datetime
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Any, Dict, List, Union, Optional
|
from typing import Any, Dict, List, Union, Optional
|
||||||
|
|
||||||
from pydantic import field_validator
|
from pydantic import field_validator, BaseModel
|
||||||
|
|
||||||
from simnet.models.base import APIModel as BaseModel, DateTimeField, add_timezone
|
from simnet.models.base import DateTimeField, add_timezone
|
||||||
|
|
||||||
from metadata.shortname import not_real_roles, roleToId, weaponToId
|
from metadata.shortname import not_real_roles, roleToId, weaponToId
|
||||||
from modules.gacha_log.const import UIGF_VERSION
|
from modules.gacha_log.const import UIGF_VERSION
|
||||||
|
5
utils/patch/pydantic_basemodel.py
Normal file
5
utils/patch/pydantic_basemodel.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import pydantic
|
||||||
|
|
||||||
|
pydantic.BaseModel.model_config["extra"] = "allow"
|
||||||
|
pydantic.BaseModel.model_config["coerce_numbers_to_str"] = True
|
||||||
|
pydantic.BaseModel.model_config["arbitrary_types_allowed"] = True
|
Loading…
Reference in New Issue
Block a user