Skip to content

Conversation

@em1208
Copy link

@em1208 em1208 commented Aug 30, 2022

…hrough model

Note: Before submitting this pull request, please review our contributing guidelines.

Description

I have found two issues when working on a nested serializer with many to many with through model. The first one is related on how APIClient prepare the request with nested json using multipart/form-data which is not passed as json to request.data, so in this case the serializer raises, complaining about missing items which is actually passed. The second one is related on how to_representation is called which is raising an attribute error. Any help to find the root cause of these two issues would be much appreciated.

@em1208
Copy link
Author

em1208 commented Aug 30, 2022

I managed to fix the to_representation issue by specifying the source parameter on the many to many serializer but there is still an issue on the default json encoding.

Copy link
Collaborator

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my questions,
were you able to fix many to many through model issue in DRF? also the name of test app as issue is quite ambigous, do you have any better name in mind? or can we add proposed tests to exiting tests/test apps?

@em1208
Copy link
Author

em1208 commented Nov 26, 2022

@auvipy I believe there is a problem with APIClient but I didn't dig further into it so I can't point precisely what is causing the issue. The many to many serializer issue does not appear as long as the source parameter is specified, I think the documentation should be clear about it. I'll be happy to rename the test app to something else, if you have any preference let me know.

@stale
Copy link

stale bot commented Oct 18, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants