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 Mar 7, 2021
1 parent e55eb9e commit ee835bf
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 @@ -397,7 +397,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 @@ -1043,7 +1045,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 ee835bf

Please sign in to comment.