must_be
Generates a list containing a single validation error message indicating that a specific option value must be of a required type.
def must_be(
type: string,
option: string,
obj: object,
id: string
) - > list
Generates a list containing a single Django system check error indicating that a specific configuration option must be of a certain type.
Parameters
| Name | Type | Description |
|---|---|---|
| type | string | The expected data type name to be displayed in the error message. |
| option | string | The name of the configuration option or setting that failed the type validation. |
| obj | object | The object instance whose class will be referenced as the source of the error in the system check. |
| id | string | A unique identifier for the system check error, typically following the Django 'app_label.E001' format. |
Returns
| Type | Description |
|---|---|
list | A list containing a single checks.Error object configured with the provided message, object context, and error identifier. |