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
{{ message }}
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
Not really sure if i am doing something wrong, but it seems like nested schema for many-to-many fields is not supported.
When i tried to just add,
many_to_many_field = fields.Nested(ManyToManyFieldSchema, many=True) it was failing bcs ManyToManyManager is not iterrable.
Managed to do it at the end, but i think its a bit hacky sollution many_to_many_field = fields.Function(lambda obj: [ManyToManyFieldSchema().dump(many-to-many-instance) for many-to-many-instance in obj.many_to_many_field.all()])
Is there a better/correct way how to handle many to many fields serialization or its really not supported "out of the box"?
Thanks!
The text was updated successfully, but these errors were encountered:
Hello,
Not really sure if i am doing something wrong, but it seems like nested schema for many-to-many fields is not supported.
When i tried to just add,
many_to_many_field = fields.Nested(ManyToManyFieldSchema, many=True)
it was failing bcs ManyToManyManager is not iterrable.Managed to do it at the end, but i think its a bit hacky sollution
many_to_many_field = fields.Function(lambda obj: [ManyToManyFieldSchema().dump(many-to-many-instance) for many-to-many-instance in obj.many_to_many_field.all()])
Is there a better/correct way how to handle many to many fields serialization or its really not supported "out of the box"?
Thanks!
The text was updated successfully, but these errors were encountered: