Decorator for `marshmallow.Schema` to sort fields in needed order while dumping
Project description
marshmallow-dumped-order
Decorator for marshmallow.Schema
to sort fields
in needed order while dumping (python36+).
from marshmallow import Schema, fields
from marshmallow_dumped_order import dumped_order
@dumped_order("name", "age")
class User(Schema):
age = fields.Int()
name = fields.String()
dumped = User().dumps({"age": 356, "name": "Jarvis"})
assert dumped.data == '{"name": "Jarvis", "age": 356}'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for marshmallow-dumped-order-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 595471d639730f621de2d75b05c6f0ccd7240e60fdbd1c03a34a70eaba939afb |
|
MD5 | 8dea883bac47d4b94cdabee8d1c83ca8 |
|
BLAKE2b-256 | fe81d5be89fbdbe2a4aebcbf29f5877e7a253f67e72a61e805e9c66bb913108a |