Skip to main content

refer_to_missing_field

Generates a list containing a Django validation error indicating that a specified option refers to a field that does not exist on the model.

def refer_to_missing_field(
field: string,
option: string,
obj: object,
id: string
) - > list

Generates a validation error message when a configuration option refers to a field name that does not exist on the target model.

Parameters

NameTypeDescription
fieldstringThe name of the field that was expected but not found on the model.
optionstringThe name of the configuration option or attribute that contains the invalid field reference.
objobjectThe object instance being checked, used to retrieve the model metadata and class type.
idstringA unique identifier for the validation error, typically following the Django check framework naming convention.

Returns

TypeDescription
listA list containing a Django validation error object detailing the missing field and the model label.