validate_model_fields
No overview available.
def validate_model_fields(
model_name: string,
data: dict,
strict: boolean = false
) - > bool
Validates that the provided dictionary contains all required fields for a specific model type and that field values meet expected constraints.
Parameters
| Name | Type | Description |
|---|---|---|
| model_name | string | The identifier of the model schema to validate against (e.g., 'User', 'Product'). |
| data | dict | The dictionary of key-value pairs representing the model instance to be validated. |
| strict | boolean = false | If set to True, validation will fail if unknown fields not defined in the schema are present. |
Returns
| Type | Description |
|---|---|
bool | True if all validation checks pass, otherwise False or raises a ValidationError depending on configuration. |