You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An extended Task validator tes.models.Task.is_valid() but not used directly by py-tes to validate a task. In principle, tasks could be easily autovalidated witht this method by calling it in a .__attrs_post_init__() method in the model definition. I'm just not quite sure if there is anything that speaks against it. If so, extended validation could also be made configurable (and, if necessary, be set to False for backwards compatibility).
Along the same lines, it might be nice to have such extended validation available for all models. Probably this could be done by defining an empty .is_valid() method in the Base class, together with a .__attrs_post_init__() method that calls it. The .is_valid() method could then be overridden by any model that requires extended validation.
Also, the .is_valid() could then be refactored to recursively validate nested models.
The text was updated successfully, but these errors were encountered:
An extended Task validator
tes.models.Task.is_valid()
but not used directly bypy-tes
to validate a task. In principle, tasks could be easily autovalidated witht this method by calling it in a.__attrs_post_init__()
method in the model definition. I'm just not quite sure if there is anything that speaks against it. If so, extended validation could also be made configurable (and, if necessary, be set toFalse
for backwards compatibility).Along the same lines, it might be nice to have such extended validation available for all models. Probably this could be done by defining an empty
.is_valid()
method in theBase
class, together with a.__attrs_post_init__()
method that calls it. The.is_valid()
method could then be overridden by any model that requires extended validation.Also, the
.is_valid()
could then be refactored to recursively validate nested models.The text was updated successfully, but these errors were encountered: