[Answered ]-Updating related/nested resource (user/userprofile) – Seeing a duplicate key error on PATCH

2👍

You can get rid of UserResource completely and add the fields from the User model you want to expose like this:

username = fields.CharField( attribute = 'user__username' )

This will not only send proper data from the User model in case of GET requests but also take care of the updates.

👤kgr

Leave a comment