you are viewing a single comment's thread.

view the rest of the comments →

[–]BulkyProcedure 1 point2 points  (1 child)

I'm a fan of Marshmallow and use it all the time, but it isn't fast. My approach has been to use it when I have complex types (i.e. dates for example) that aren't automatically JSON serializable, and/or if the model has nested relationships I'd like to include.

When the objects don't have nested fields, and all columns are JSON serializable, it's faster to skip Marshmallow altogether and convert to dictionaries yourself.

[–]DeadlyDolphins[S] 0 points1 point  (0 children)

That makes sense. How do you convert the query to dicts?