colander v1.0.b1 Release Notes
Release Date: 2013-09-01 // over 10 years ago-
๐ Bug Fixes
๐ In 1.0a1, there was a change merged from https://github.com/Pylons/colander/pull/73 which made it possible to supply
None
as thedefault
value for a String type, and upon serialization, the value would be rendered ascolander.null
if the default were used. This confused people who were actually supplying the valueNone
as a default when the associated appstruct had no value, so the change has been reverted. When you supplyNone
as thedefault
argument to a String, the rendered serialize() value will again be'None'
. Sorry.Normalize
colander.Function
argumentmessage
to bemsg
. This now matches other APIs within Colander. Themessage
argument is now deprecated and a warning will be emitted. https://github.com/Pylons/colander/issues/31 https://github.com/Pylons/colander/issues/64iso8601.py
: ConvertValueError
(raised bydatetime
) intoParseErrorr
inparse_date
, so that the validation machinery upstream handles it properly.๐
iso8601.py
: Correctly parse datetimes with a timezone of Z even when the default_timezone is set. These previously had the default timezone.colander.String
schema type now raisescolander.Invalid
when trying to deserialize a non-string item. See https://github.com/Pylons/colander/issues/100
๐ Features
โ Add
colander.List
type, modeled ondeform.List
: this type preserves ordering, and allows duplicates.0๏ธโฃ It is now possible to use the value
colander.drop
as thedefault
value for items that are subitems of a mapping. Ifcolander.drop
is used as thedefault
for a subnode of a mapping schema, and the mapping appstruct being serialized does not have a value for that schema node, the value will be omitted from the serialized mapping. For instance, the following script, when run would not raise an assertion error::class What(colander.MappingSchema): thing = colander.SchemaNode(colander.String(), default=colander.drop)
result = What().serialize({}) # no "thing" in mapping assert result == {}
The
typ
of aSchemaNode
can optionally be pased in as a keyword argument. See https://github.com/Pylons/colander/issues/90๐ Allow interpolation of
missing_msg
with propertiestitle
andname