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.

sheraf.health.checks.check_conflict_resolution()[source]

Checks wether sheraf object conflicts resolutions are possible. When this is KO, it is generally because sheraf is not installed in the ZEO environnement, so ZEO cannot solve sheraf object conflicts.

sheraf.health.checks.check_model_index(model)[source]

Given a model, for every index table, reads every mapping in the table and checks that the mappin belongs a model.

This finds orphans models.

Fixes

Fixes are helpers that repair broken or unvalid data.