MCPcopy Index your code
hub / github.com/fastapi/sqlmodel / get_model_fields

Function get_model_fields

sqlmodel/_compat.py:83–91  ·  view source on GitHub ↗
(model: InstanceOrType[BaseModel])

Source from the content-addressed store, hash-verified

81
82
83def 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
94def init_pydantic_private_attrs(new_object: InstanceOrType["SQLModel"]) -> None:

Callers 2

__new__Method · 0.85
sqlmodel_updateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…