Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix empty pk detection in HyperlinkRelatedField.get_url#3962

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@jslang
Copy link
Contributor

This implementation allows detection of empty values that are non-nullable, allowing the field to returnNone values for such cases.Fixes#3959

@jpadilla
Copy link
Contributor

@jslang lgtm, thanks!

@jpadillajpadilla added this to the3.3.3 Release milestoneFeb 25, 2016

classTestHyperlinkedRelatedField(APISimpleTestCase):
defsetUp(self):
self.instance=MockObject(pk=1,name='foo')
Copy link
Contributor

Choose a reason for hiding this comment

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

We can get rid of thisself.instance which is not used in this test case.

@jslangjslangforce-pushed thefix_null_check_in_hyperlinkrelation branch from125334d to186c0e3CompareFebruary 29, 2016 20:55
This implementation allows detection of empty values that are non-nullable, allowing the field to return None values for such cases
@jslangjslangforce-pushed thefix_null_check_in_hyperlinkrelation branch from186c0e3 to7ac8cc7CompareFebruary 29, 2016 20:57
@xordoquy
Copy link
Contributor

Looks good to me too.
Just a question here, would it make sense to define the list of empty values in the class ?
Just in case someone wanted to override this. I have no idea whether this would be a common need or whether it's a too specific use case.

lovelydinosaur added a commit that referenced this pull requestMar 4, 2016
Fix empty pk detection in HyperlinkRelatedField.get_url
@lovelydinosaurlovelydinosaur merged commit82ec6e8 intoencode:masterMar 4, 2016
@lovelydinosaur
Copy link
Contributor

Thanks!

xordoquy added a commit to linovia/django-rest-framework that referenced this pull requestMar 7, 2016
@jslangjslang deleted the fix_null_check_in_hyperlinkrelation branchSeptember 16, 2016 22:28
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

3.3.3 Release

Development

Successfully merging this pull request may close these issues.

4 participants

@jslang@jpadilla@xordoquy@lovelydinosaur

[8]ページ先頭

©2009-2025 Movatter.jp