nti.schema.interfaces¶
Interfaces describing the events and fields this package uses.
Also utility functions.
- exception VariantValidationError(field, value, errors)[source]¶
An error raised when a value is not suitable for any of the fields of the variant.
The
errorsattribute is an ordered sequence of validation errors, with one raised by each field of the variant in turn.Added in version 1.8.0.
- errors = ()¶
A sequence of validation errors
- find_most_derived_interface(ext_self, iface_upper_bound, possibilities=None)[source]¶
Search for the most derived version of the interface
iface_upper_boundimplemented byext_selfand return that. Always returns at leastiface_upper_bound- Parameters:
possibilities – An iterable of schemas to consider. If not given, all the interfaces provided by
ext_selfwill be considered.
- exception InvalidValue(*args, field=None, value=None)[source]¶
Adds a field specifically to carry the value that is invalid.
Deprecated since version 1.4.0: This is now just a convenience wrapper around
zope.schema.interfaces.InvalidValuethat callszope.schema.interfaces.ValidationError.with_field_and_value()before returning the exception. You should always catchzope.schema.interfaces.InvalidValue.