def __chz_validate__()

in chz/data_model.py [0:0]


def __chz_validate__(self) -> None:
    for field in self.__chz_fields__.values():
        if field._munger is None:
            for validator in field._validator:
                # So without mungers, we always run validators against the raw value
                # There is currently code that relies on not running validator against a potential
                # user-specified init_property
                # TODO: is it unfortunate that x_name appears in error messages?
                validator(self, field.x_name)
        else:
            # With mungers, we run validators against both the munged and unmunged value
            # I'm willing to reconsider this, but want to be conservative for now
            for validator in field._validator:
                validator(self, field.logical_name)
                validator(self, field.x_name)
    for validator in getattr(self, "__chz_validators__", []):
        validator(self)