Skip to content

Commit 6d19777

Browse files
author
François Degrave
committed
[IMP] model_serializer: allow to pass the 'many' param to dump
1 parent e52eca7 commit 6d19777

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

model_serializer/core.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ class ModelSerializer(Datamodel, metaclass=MetaModelSerializer):
2323
_model = None
2424
_model_fields = []
2525

26+
def dump(self, many=None):
27+
with self.__dump_mode_on__():
28+
dump = self.__schema__.dump(self, many=many)
29+
return dump
30+
2631
@classmethod
2732
def _check_nested_class(cls, marshmallow_field, registry):
2833
"""If `marshmallow_field` is a nested datamodel (relational field), we check

0 commit comments

Comments
 (0)