You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a problem when the post_dump hook queries stuff from a database as I would end up with n individual queries instead of a single one where I can use IN to efficiently get data for all the objects in the list.
Are there any decent workarounds for this? One thing that came to my mind is using this instead of List(Nested), but it feels much uglier...
I just realized that Nested(..., many=True) is still a thing. I had the impression it was removed in marshmallow 3 but apparently that's not the case, since this still works perfectly fine:
Another poor soul here having the same question. I am about to replace fields.List with Nested(many=True) as I want to reuse a validation without the need to change things in the parent schemas.
@sloria Could you enlighten us if Nested(many=True) will be a thing in the future or not? And if not how to handle the validation case from above?
This gives me the following output:
However, I expected this:
This is a problem when the
post_dump
hook queries stuff from a database as I would end up with n individual queries instead of a single one where I can use IN to efficiently get data for all the objects in the list.Are there any decent workarounds for this? One thing that came to my mind is using this instead of
List(Nested)
, but it feels much uglier...The text was updated successfully, but these errors were encountered: