🐛 Fix pydantic basemodel v2 default config

This commit is contained in:
xtaodada 2024-12-02 13:27:36 +08:00
parent cab9ccad63
commit 22dcbff0f8
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 7 additions and 2 deletions

View File

@ -2,9 +2,9 @@ import datetime
from enum import Enum
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, lightConeToId
from modules.gacha_log.const import UIGF_VERSION

View 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