Skip to content

Commit

Permalink
Docs: remove "Ordering Output" section from quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrech committed Dec 30, 2022
1 parent 9507dfc commit 52d7e24
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -524,37 +524,6 @@ Note that ``name`` will be automatically formatted as a :class:`String <marshmal
# No need to include 'uppername'
additional = ("name", "email", "created_at")
Ordering Output
---------------

To maintain field ordering, set the ``ordered`` option to `True`. This will instruct marshmallow to serialize data to a `collections.OrderedDict`.

.. code-block:: python
from collections import OrderedDict
from pprint import pprint
from marshmallow import Schema, fields
class UserSchema(Schema):
first_name = fields.String()
last_name = fields.String()
email = fields.Email()
class Meta:
ordered = True
u = User("Charlie", "Stones", "[email protected]")
schema = UserSchema()
result = schema.dump(u)
assert isinstance(result, OrderedDict)
pprint(result, indent=2)
#  OrderedDict([('first_name', 'Charlie'),
# ('last_name', 'Stones'),
# ('email', '[email protected]')])
Next Steps
----------

Expand Down

0 comments on commit 52d7e24

Please sign in to comment.