flask_restful_dbbase.resources.CollectionModelResource.screen_data¶
- CollectionModelResource.screen_data(data, obj_params, skip_missing_data=False)¶
Assumes data is deserialized
This function screens data from a few parameters, missing data, unneeded fields in data, excessive string lengths, improper numbers.
Note that this function does not exhaustively determine the problem. It ends on first failure.
- Parameters:
data – (dict) : incoming data
obj_params – (dict) : table parameters
skip_missing_data – (bool) : Flag to check for all for record
- Returns:
status – (bool) : True, Successful screening msg : (None : dict) : description of the problem
Each test for bad data outputs a status of True, None for each successful test. Unsuccessful tests add the problem to an error list to be returned at the end. That way, there is a relatively complete list of the problems encountered.