Skip to content

resource id field should be based on serializer lookup_field #295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AndreiHondrari opened this issue Nov 3, 2016 · 2 comments
Closed

Comments

@AndreiHondrari
Copy link

AndreiHondrari commented Nov 3, 2016

Currently if you have a lookup_field on serializers that is different from the 'pk', you will be able to do `/api/objects/{new_lookup_field}' but in the payload the "id" will still be the numerical one that django uses by default. This goes for GET and PATCH. I think this is an inconsistency.

@AndreiHondrari
Copy link
Author

AndreiHondrari commented Nov 3, 2016

I started implementing something like this over here .

The changes that are covered:

  • primary resource object ID replace
  • included resource object ID replace

Still to do:

  • relationship object ID replace
  • tests to cover some not-happy flows

@sliverc
Copy link
Member

sliverc commented May 3, 2018

I think #155 also addresses this issue and there is an open PR #409

Closing this issue to focus on #155 If you think this is a different issue though please comment.

@sliverc sliverc closed this as completed May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants