Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /randovania_randovania /randovania /lib /json_base_model.py
| import typing | |
| from pydantic import BaseModel, ConfigDict | |
| class JsonBaseModel(BaseModel): | |
| """ | |
| Base class for pydantic models that should expose the same as_json/from_json | |
| interface as JsonDataclass, so both can be used interchangeably in the codebase. | |
| """ | |
| model_config = ConfigDict( | |
| from_attributes=True, | |
| ser_json_bytes="base64", | |
| val_json_bytes="base64", | |
| ) | |
| def as_json(self) -> dict[str, typing.Any]: | |
| return self.model_dump(mode="json") | |
| def from_json(cls, param: typing.Any, **extra: typing.Any) -> typing.Self: | |
| return cls.model_validate(param) | |
Xet Storage Details
- Size:
- 653 Bytes
- Xet hash:
- de3fafbe49edbeb8950f399ec0e2a97b47e761c0c0c71a0850c83e56f11e2b40
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.