Marshmallow is:
A lightweight library for converting complex datatypes to and from native Python datatypes.
An ORM .
A lightweight web framework that replaces Flask.
SQLAlchemy is:
A lightweight library for converting complex datatypes to and from native Python datatypes.
An ORM .
A lightweight web framework that replaces Flask.
The
marshmallow.pre_load
decorator:Registers a method to run after any instance of the
MessageSchema
class is created.Registers a method to invoke after serializing an object.
Registers a method to invoke before deserializing an object.
The
dump
method for any instance of a Schema subclass:Routes URLs to Python primitives.
Persists the instance or collection of instances passed as an argument to the database.
Takes the instance or collection of instances passed as an argument and applies the field filtering and output formatting specified in the Schema subclass to the instance or collection of instances.
When we declare an attribute as an instance...
You're reading from Building RESTful Python Web Services
The rest of the page is locked
You have been reading a chapter from
Building RESTful Python Web ServicesPublished in: Oct 2016Publisher: PacktISBN-13: 9781786462251
© 2016 Packt Publishing Limited All Rights Reserved