Skip to content

Commit

Permalink
🐛 Fix pydantic basemodel v2 default config
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Dec 2, 2024
1 parent cab9cca commit 22dcbff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/gacha_log/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
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
Expand Down
5 changes: 5 additions & 0 deletions utils/patch/pydantic_basemodel.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 22dcbff

Please sign in to comment.