Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DictField / ListField: how to pass dict / list as default? #230

Closed
lafrech opened this issue Mar 28, 2020 · 0 comments · Fixed by #231
Closed

DictField / ListField: how to pass dict / list as default? #230

lafrech opened this issue Mar 28, 2020 · 0 comments · Fixed by #231
Milestone

Comments

@lafrech
Copy link
Collaborator

lafrech commented Mar 28, 2020

Since #154, default values must be passed in deserialized form for consistency with marshmallow 3.

One can't write this anymore:

list_field = ListField(IntField, default=list)

One must now write

from umongo.data_objects import List
list_field = ListField(IntField, default=List)

Not ideal.

Shall we still take default values in serialized form in umongo even if it is not consistent with marshmallow 3? Is there another way to cast the default value in these specific cases?

Edit: in fact, the workaround above doesn't work, so it is worse than not ideal, it is a blocker.

@lafrech lafrech added this to the 3.0 milestone Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant