[RFR] [OSF-8498] API: Add id and type to relationships#7702
Closed
TomBaxter wants to merge 1 commit into
Closed
Conversation
| if related_url and (len(related_path.split('/')) & 1) == 1: | ||
| resolved_url = resolve(related_path) | ||
| related_class = resolved_url.func.view_class | ||
| if not hasattr(related_class, 'LIST_FIELDS'): |
Collaborator
There was a problem hiding this comment.
As discussed, better to check if the view derives from mixins.mixins.RetrieveModelMixin or doesn't derive from mixins.ListModelMixin
Member
Author
There was a problem hiding this comment.
Complete. I'll add a test and set ticket to CR.
[#OSF-8498] Return relationship data for those relations of the form... proto://host:port/v2/<namespace>/<namespace_id>/
brianjgeiger
approved these changes
Sep 20, 2017
Member
Author
|
Merged in #7807 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[#OSF-8498]
Purpose
Return relationship data for those relations of the form...
proto://host:port/v2//<namespace_id>/
Changes
Update api/base/serializers.py::RelationshipField::to_representation to add "data" to "relationships"
Side effects
This PR makes assumptions about the form of endpoint URLs and the naming standard of kwargs passed to views. I don't believe that failures to live up to my assumptions will result in returning bad data, it should result in no passed data, but bad data is a possibility.
Ticket
OSF-8498