Replies: 3 comments 3 replies
-
Sorry, only used load_only in 1.4.x, but that code has been overwritten! Maybe in the docs: It's worth noting: don't use a string for the load_only field, but a table field |
Beta Was this translation helpful? Give feedback.
-
Example
Throw an exception
|
Beta Was this translation helpful? Give feedback.
-
This is because the entire instance is returned in the query, and the entire instance is serialized before it is finally returned, and because only some of the fields are loaded, other fields will raise an error when serialized Solution: Use select_to_dict or select_to_json can to exclude the wrong fields. |
Beta Was this translation helpful? Give feedback.
-
An exception will occur when sqlalchemy2 uses load_only to load only specified fields.
Are there any working examples? Thanks
Beta Was this translation helpful? Give feedback.
All reactions