exclude_default
No overview available.
def exclude_default(
model: BaseModel,
data: dict
) - > dict
Filters out keys from a dictionary whose values match their defined default values in a Pydantic model.
Parameters
| Name | Type | Description |
|---|---|---|
| model | BaseModel | The Pydantic model instance used to retrieve default field values for comparison. |
| data | dict | The dictionary of data to be filtered by comparing against the model defaults. |
Returns
| Type | Description |
|---|---|
dict | A dictionary containing only the fields that differ from the model's default values. |