(model: InstanceOrType[BaseModel])
| 81 | |
| 82 | |
| 83 | def get_model_fields(model: InstanceOrType[BaseModel]) -> dict[str, "FieldInfo"]: |
| 84 | # TODO: refactor the usage of this function to always pass the class |
| 85 | # not the instance, and then remove this extra check |
| 86 | # this is for compatibility with Pydantic v3 |
| 87 | if isinstance(model, type): |
| 88 | use_model = model |
| 89 | else: |
| 90 | use_model = model.__class__ |
| 91 | return use_model.model_fields |
| 92 | |
| 93 | |
| 94 | def init_pydantic_private_attrs(new_object: InstanceOrType["SQLModel"]) -> None: |
no outgoing calls
no test coverage detected
searching dependent graphs…