dbbase.model.Model.validate_record

Model.validate_record(camel_case=False)[source]

This function attempts to report any missing data from a record. Intended to be run just prior to saving, the idea is that meaningful feedback could be provided without raising an error in the database.

The function walks the record for required fields. If there are no defaults, local or server, that will be filled in for that column that triggers a report.

One response is a dict with a key of “missing_values”. Another response is a dict foreign keys that have no corresponding id found in the foreign table.

Default:

validate_record(camel_case=False)

Parameters

camel_case (bool) – error message converted to camel case

Return

status (bool) : True if no errors found error_dict (None : dict ) | a dict that contains an error list