Skip to content

Added get_related_field_name method to RelationshipView #225

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

Merged
merged 2 commits into from
Apr 18, 2016
Merged

Added get_related_field_name method to RelationshipView #225

merged 2 commits into from
Apr 18, 2016

Conversation

Anton-Shutik
Copy link
Contributor

No description provided.

@Anton-Shutik
Copy link
Contributor Author

Anton-Shutik commented Apr 15, 2016

Sometimes I need to use other field name in the url rather that it is on e model.
For example:

class Model(models.Model):
    field1 = models.CharField()

but relation self link should be:
api/account/123/relations/field2

By that way it will be easier to override that name.

What do you think ?

@jerel
Copy link
Member

jerel commented Apr 15, 2016

It seems good to me to extract this to a method. Could you also add some docs for others that will want to use it?

@Anton-Shutik
Copy link
Contributor Author

@jerel Just added the note

@jerel jerel merged commit bb26764 into django-json-api:develop Apr 18, 2016
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

Successfully merging this pull request may close these issues.

2 participants