Browse Source

Fix index example for TaggedJSONSerializer.register()

Made the example use a keyword, rather than a positional argument, as
the intent here is to show how to insert a tag with higher precedence.
As a positional argument, this would have been passed to ``force``
instead of ``index``.
pull/2711/head
Nick Pope 7 years ago
parent
commit
eaedb9320c
  1. 2
      flask/json/tag.py

2
flask/json/tag.py

@ -36,7 +36,7 @@ processes dicts first, so insert the new tag at the front of the order since
def to_python(self, value):
return OrderedDict(value)
app.session_interface.serializer.register(TagOrderedDict, 0)
app.session_interface.serializer.register(TagOrderedDict, index=0)
:copyright: © 2010 by the Pallets team.
:license: BSD, see LICENSE for more details.

Loading…
Cancel
Save