python-pyfields icon indicating copy to clipboard operation
python-pyfields copied to clipboard

Support global checker

Open smarie opened this issue 6 years ago • 2 comments

if the class contains a __validate_all_fields__(self) method, it will be called everytime a field is modified. This is quite heavy but might be useful in some rare cases where validation can not be done in each of the fields validators

  • you can disable this temporarily by doing "with skip_global_validation(o): ..." (implementation note: this would set a __skip_global_validation__ flag on the instance, read by the fields setters)

  • or permanently with set_global_validation(o, enabled=False) ?

smarie avatar Sep 07 '19 14:09 smarie

Do we really want that kind of complexity ? Real-world evidence needed

smarie avatar Sep 09 '19 07:09 smarie

This is an equivalent functionality : https://zopeinterface.readthedocs.io/en/latest/README.html#invariants

smarie avatar Sep 09 '19 08:09 smarie