Skip to content

Commit

Permalink
fix field order breaking on py35/36
Browse files Browse the repository at this point in the history
  • Loading branch information
dsimidzija committed Aug 19, 2020
1 parent 821c931 commit 4f04fbe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/marshmallow/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ def __init__(
self.fields = {} # type: typing.Dict[str, ma_fields.Field]
self.load_fields = {} # type: typing.Dict[str, ma_fields.Field]
self.dump_fields = {} # type: typing.Dict[str, ma_fields.Field]
self.dump_serializers = {} # type: typing.Dict[str, typing.Callable]
self.dump_serializers = (
self.dict_class()
) # type: typing.Dict[str, typing.Callable]
self._init_fields()
messages = {}
messages.update(self._default_error_messages)
Expand Down Expand Up @@ -1041,7 +1043,7 @@ def _init_fields(self) -> None:
self.fields = fields_dict
self.dump_fields = dump_fields
self.load_fields = load_fields
self.dump_serializers = {}
self.dump_serializers = self.dict_class()

def on_bind_field(self, field_name: str, field_obj: ma_fields.Field) -> None:
"""Hook to modify a field when it is bound to the `Schema`.
Expand Down

0 comments on commit 4f04fbe

Please sign in to comment.