Changes¶
1.20.0 (2026-06-01)¶
Add support for Python 3.15.
Add
EqHash(supereq=True)to also work for comparing mutable and immutable lists/tuples.
1.19.0 (2025-11-14)¶
Add support for Python 3.14; drop Python < 3.12.
Acquisition is now an optional dependency, not installed by default.
1.18.0 (2024-11-18)¶
Make
nti.schema.field.FieldConvertera public utility class.
1.17.0 (2024-11-08)¶
Drop support for anything less than Python 3.10.
Add support for all current versions of Python, up to 3.13.
Use native namespace packages.
1.16.0 (2021-05-08)¶
Add support for Python 3.9.
Drop support for Python 3.5.
Fix deprecation warnings emitted by using this package, and make the deprecation warnings it emits more precise. See issue 58.
Fix constructing a
Variantto do some extra validation ofIMappingfields to require that both thekey_typeandvalue_typeare given. Previously, if one or both were leftNone, anAttributeErrorwould be raised when the field was asked to validate data or itsfromObject()method was called. Now, aRequiredMissingerror will be raised when theVariantis created. Some other nested uses ofDictfields, such as aSequence, could also have raised theAttributeError; this may change in the future to raise at construction time as well.See issue 59.
1.15.1 (2020-07-02)¶
Fix plurality of error message for fields with min length of 1.
1.15.0 (2020-05-06)¶
Improve the speed of
SchemaConfiguredsubclasses. See issue 54.This involves some caching, so be sure to read the documentation for
nti.schema.schemaif you ever mutate classes directly, or mutate the results ofschemadict.
1.14.0 (2020-03-27)¶
Require zope.interface 5.0.0 and related dependencies.
Ensure all objects have consistent interface resolution orders.
Add support for Python 3.8.
1.13.1 (2019-06-11)¶
StrippedValidTextLineshould accept single character lines.
1.13.0 (2019-05-22)¶
Ensure
StrippedValidTextLinecorrectly recognizes single character values as stripped. Previously, ‘b’ would have been rejected.
1.12.0 (2018-10-10)¶
JSON schemas report the schema for
IObjectfields and the schemas for the possible fields inIVariant.Fields in JSON schemas may specify a JSON-serializable dictionary to be passed as the
application_infoschema value. See issue 44.JSON schemas now output more constraints automatically. See issue 47.
1.11.0 (2018-10-10)¶
1.10.0 (2018-10-04)¶
Add
nti.schema.fieldproperty.field_nameto compensate for the mangling thatFieldPropertyStoredThroughFielddoes.
1.9.2 (2018-10-04)¶
Fix
Variantand other implementations ofIFromObjectto stop passing known non-text values tofromUnicodemethods. This only worked with certain fields (such aszope.schema.Number) that could accept non-text values, usually by implementation accident, and could have surprising consequences. Instead, non-text values will be passed to thevalidatemethod.Fix
Variantto stop double-validating values. The underlyingfromUnicode,fromBytesorfromObjectmethods were supposed to already validate.
1.9.1 (2018-10-03)¶
Make
VariantValidationErrorandVarianthave more useful string representations.Make
fromObjectmethods more gracefully handle an AttributeError raised by an underlyingfromUnicodemethod on non-string input (such as None). This is especially helpful forVariantfields because they can catch the error and continue to the next field.Fix
Variant,TupleFromObject,DictFromObject,ListFromObjectandListOrTupleFromObjectto allow themissing_value(which defaults toNone) in theirfromObjectmethods; passing that value in simply returns it without raising an exception if the field is not required. If the field is required, aRequiredMissingis raised. Previously the sequences raised aWrongTypeerror, whileVariantmay or may not have raised an error, depending on the underlying fields in use.
1.9.0 (2018-10-02)¶
Variantobjects now automatically addfromObjectsupport toICollectionandIMappingfields that do not already provide it, if theirvalue_type(andkey_type) qualify by being either anObjectfield, or something that providesIFromObjector can be made to, such as a collection or mapping.
1.8.0 (2018-09-28)¶
Add
VariantValidationError, an error raised by variant fields when none of their constituent fields could adapt or validate the value.
1.7.0 (2018-09-19)¶
Add support for
IFromBytesin zope.schema 4.8.0.The
VariantandListOrTupleFromObject,TupleFromObject,DictFromObjectfields all have tweaked behaviour infromObject. If the incoming value is a bytestring or text string, the underlying field’sfromBytesandfromUnicodewill be called in preference to afromObject, if that method is implemented.ValidSetandUniqueIterablenow implementfromObject.All fields that implement
fromObjectnow accept anObjectfield for theirvalue_type(andkey_typein the case ofDictFromObject) and will attempt to adapt objects that do not provide the schema infromObject.
1.6.0 (2018-09-18)¶
Adjust the deprecated
zope.schema.interfaces.InvalidValueto be a simple alias forzope.schema.interfaces.InvalidValue(while preserving the constructor) for improved backwards compatibility.
1.5.0 (2018-09-11)¶
Add support for zope.schema 4.7.0; drop support for older versions.
1.4.2 (2018-09-10)¶
1.4.1 (2018-09-10)¶
Make
nti.schema.interfaces.InvalidValuea class again. It is deprecated. See issue 24.
1.4.0 (2018-09-10)¶
Drop support for
dm.zope.schemafields, in particular theObjectfield. The validation performed byzope.schema.Objectis much improved.Drop support for
zope.schemaolder than 4.6.1.Deprecate
nti.schema.field.Number.Add support for Python 3.7.
1.3.3 (2018-09-07)¶
Minor fix for changes in zope.schema 4.6.0 (import
BeforeObjectAssignedEventfrom its new, but still private, location).
1.3.2 (2017-10-24)¶
Depend on zope.deferredimport >= 4.2.1 to be able to generate Sphinx documentation.
Clean up code to match PEP8.
1.3.1 (2017-10-18)¶
Fix an
UnboundLocalErroron Python 3 in theVariantfield. See issue 14.
1.3.0 (2017-07-06)¶
Drop the Python 2 dependency on
plone.i18nin favor of the new librarynti.i18n, which supports Python 3. Ifplone.i18nis installed, it should not be configured (ZCML), but its utility objects can be looked up by either interface.
1.2.0 (2017-05-17)¶
Remove use of
unicode_literals.Add support for Python 3.6.
The
SchemaConfiguredconstructor doesn’t hide errors when checking for properties on Python 2. See issue 11.
1.1.3 (2017-01-17)¶
Add info to minLength validation message.
1.1.2 (2016-09-14)¶
Add
Acquisitionandzope.eventas install dependencies. Previously they were only pulled in via thetestextra.
1.1.1 (2016-09-08)¶
Substantial speedups to the hash functions generated by
EqHash.Substantial speedups to the equality functions generated by
EqHash.
1.1.0 (2016-07-29)¶
Add support for Python 3. Note the countries vocabulary will not be complete on Python 3.
Drop the
dolmen.builtinsdependency.Drop the
dm.zope.schemadependency.The
plone.i18ndependency is Python 2 only (and can even be removed).The matchers in
nti.schema.testinghave been moved tonti.testing.matchers.Using
AdaptingFieldPropertywill now raise the more specificSchemaNotProvidederror instead of aTypeErrorif adapting the value fails.EqHashhas moved fromnti.schema.schematonti.schema.eqhash. A compatibility shim remains.