Health
- sheraf.health.check_health(*args, model_checks=None, instance_checks=None, attribute_checks=None, other_checks=None, console=None)[source]
Takes some modules in parameters.
- Parameters
model_checks – If None, check also model consistency (see constant model_check_funcs)
instance_checks – If None, check all instance consistency rules. Else, give the list of wanted checking rules (see constant instance_check_funcs)
attribute_checks – If None, check all attribute consistency rules. Else, give the list of wanted checking rules (see constant instance_check_funcs) The function will discover models in the modules, analyze every model instance, and return a health report in JSON. Depending on the result, you may need to apply some fixes.
Checks
- sheraf.health.checks.check_attributes_index(model_instance)[source]
Given a model instance, computes all the values for all the indexes, then checks the index table if the values match the model instance.
This finds instances that are not synchronized with theirs indexes.
Fixes
Fixes are helpers that repair broken or unvalid data.