- Fix bug that raised error when passing
extradata together withmany=True. Thanks Joe Alcorn for reporting. - If
required=Truevalidation is violated for a givenField, it will raise an error message that is different from the message specified by theerrorargument. Thanks Anders Steinlein.
- Fix bug in serializing keyed tuple types, e.g.
namedtupleandKeyedTuple. - Nested field can load a serializer by its class name as a string. This makes it easier to implement 2-way nesting.
- Make Serializer.data override-able.
- Add
Serializer.factoryfor creating a factory function that returns a Serializer instance. MarshallingErrorstores its underlying exception as an instance variable. This is useful for inspecting errors.fields.Selectis aliased tofields.Enum.- Add
fields.__all__andmarshmallow.__all__so that the modules can be more easily extended. - Expose
Serializer.OPTIONS_CLASSas a class variable so that options defaults can be overridden. - Add
Serializer.process_datahook that allows subclasses to manipulate the final output data.
- Add
json_moduleclass Meta option. - Add
requiredoption to fields . Thanks @DeaconDesperado. - Tested on Python 3.4 and PyPy.
- Fix
Integerfield default. It is now0instead of0.0. Thanks @kalasjocke - Add
contextparam toSerializer. Allows accessing arbitrary objects inFunctionandMethodfields. FunctionandMethodfields raiseMarshallingErrorif their argument is uncallable.
- Enable custom field validation via the
validateparameter. - Add
utils.from_rfcfor parsing RFC datestring to Python datetime object.
- Avoid unnecessary attribute access in
utils.to_marshallable_typefor improved performance. - Fix RFC822 formatting for localized datetimes.
- Can customize validation error messages by passing the
errorparameter to a field. - Backwards-incompatible: Rename
fields.NumberField->fields.Number. - Add
fields.Select. Thanks @ecarreras. - Support nesting a Serializer within itself by passing
"self"intofields.Nested(only up to depth=1). - Backwards-incompatible: No implicit serializing of collections. Must set
many=Trueif serializing to a list. This ensures that marshmallow handles singular objects correctly, even if they are iterable. - If Nested field
onlyparameter is a field name, only return a single value for the nested object (instead of a dict) or a flat list of values. - Improved performance and stability.
- An object's
__marshallable__method, if defined, takes precedence over__getitem__. - Generator expressions can be passed to a serializer.
- Better support for serializing list-like collections (e.g. ORM querysets).
- Other minor bugfixes.
- Add
additionalclas Meta option. - Add
dateformatclass Meta option. - Support for serializing UUID, date, time, and timedelta objects.
- Remove
Serializer.to_datamethod. Just useSerialize.dataproperty. - String field defaults to empty string instead of
None. - Backwards-incompatible:
isoformatandrfcformatfunctions moved to utils.py. - Backwards-incompatible: Validation functions moved to validate.py.
- Backwards-incompatible: Remove types.py.
- Reorder parameters to
DateTimefield (first parameter is dateformat). - Ensure that
to_jsonreturns bytestrings. - Fix bug with including an object property in
fieldsMeta option. - Fix bug with passing
Noneto a serializer.
- Fix bug with serializing dictionaries.
- Fix error raised when serializing empty list.
- Add
onlyandexcludeparameters to Serializer constructor. - Add
strictparameter and option: causes Serializer to raise an error if invalid data are passed in, rather than storing errors. - Updated Flask + SQLA example in docs.
- Declaring Serializers just got easier. The class Meta paradigm allows you to specify fields more concisely. Can specify
fieldsandexcludeoptions. - Allow date formats to be changed by passing
formatparameter toDateTimefield constructor. Can either be"rfc"(default),"iso", or a date format string. - More useful error message when declaring fields as classes (instead of an instance, which is the correct usage).
- Rename MarshallingException -> MarshallingError.
- Rename marshmallow.core -> marshmallow.serializer.
- Allow prefixing field names.
- Fix storing errors on Nested Serializers.
- Python 2.6 support.
- Field-level validation.
- Add
fields.Method. - Add
fields.Function. - Allow binding of extra data to a serialized object by passing the
extraparam when initializing aSerializer. - Add
relativeparamater tofields.Urlthat allows for relative URLs.
- First release.