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
In this synthetic example I have a list of objects, and I need each of them to pass its own piece if data to nested ones on loading.
I'm using context to pass this piece of data to nested schema and expecting each of InnerSchema to receive its own piece of data corresponding to exact parent object.
Loading data with ListNestedSchema does exactly what I expect, however NestedManySchema works in a different manner. It looks like the reason is that the order of pre_load hooks execution differs and I'm not sure if it was designed in such way or is it a bug.
I guess this difference is worth to notice in #779
In my project I had to use exactly List(Nested(...)) field, because I use the same context key for storing each prefix, but I guess if I had an option to access the parent object, like in #940 , I could store all prefixes in context separately and get the exact one in InnerSchema based on which parent object is passed.
In that case I could be using either of List(Nested(...)) or Nested(..., many=True) fields
Hello, I found a strange difference in load behavior between List(Nested) and Nested(many=True)
Consider the following example:
In this synthetic example I have a list of objects, and I need each of them to pass its own piece if data to nested ones on loading.
I'm using
context
to pass this piece of data to nested schema and expecting each ofInnerSchema
to receive its own piece of data corresponding to exact parent object.Loading data with
ListNestedSchema
does exactly what I expect, howeverNestedManySchema
works in a different manner. It looks like the reason is that the order ofpre_load
hooks execution differs and I'm not sure if it was designed in such way or is it a bug.I'm using marshmallow==3.14.1 with Python 3.8.2
The text was updated successfully, but these errors were encountered: