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

Use verbose_name instead of object_name in error messages#4299

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

Merged
lovelydinosaur merged 3 commits intoencode:masterfromsassanh:master
Jul 26, 2016
Merged

Use verbose_name instead of object_name in error messages#4299

lovelydinosaur merged 3 commits intoencode:masterfromsassanh:master
Jul 26, 2016

Conversation

@sassanh
Copy link
Contributor

Note: Before submitting this pull request, please review ourcontributing guidelines.

Description

It should useverbose_name, notobject_name, took me 2 hours to find out why parts of error were not translated as I didn't expect it to happen in drf.

@sassanh
Copy link
ContributorAuthor

Related to#4300.

@lovelydinosaur
Copy link
Contributor

Yup this looks good, thanks!
Note that there's a test case that also needs to be updated as part of this pull request.

tests/test_validators.py:80: in test_is_not_uniqueassert serializer.errors == {'username': ['UniquenessModel with this username already exists.']}E   AssertionError: assert {'username': ...ady exists.']} == {'username': [...ady exists.']}E     Differing items:E     {'username': ['uniqueness model with this username already exists.']} != {'username': ['UniquenessModel with this username already exists.']}

@sassanh
Copy link
ContributorAuthor

I'll upgrade the test, could you please review my 2 commits and tell me which one is the right one?

@codecov-io
Copy link

codecov-io commentedJul 26, 2016
edited
Loading

Current coverage is 91.19% (diff: 100%)

Merging#4299 intomaster will increase coverage by<.01%

@@             master      #4299   diff @@==========================================  Files            52         52            Lines          5776       5781     +5     Methods           0          0            Messages          0          0            Branches          0          0          ==========================================+ Hits           5267       5272     +5  Misses          509        509            Partials          0          0

Powered byCodecov. Last update0f61c9e...09d5f85

@lovelydinosaur
Copy link
Contributor

lovelydinosaur commentedJul 26, 2016
edited
Loading

I'll upgrade the test, could you please review my 2 commits and tell me which one is the right one?

Sorry, could you be more explicit?
The change in the PR looks correct, as it currently stands.

return'%(model_name)s-detail'% {
'app_label':model._meta.app_label,
'model_name':model._meta.verbose_name.lower()
'model_name':model._meta.object_name.lower()
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@tomchristie is it correct the way it is or should I convert thisobject_name toverbose_name too?

Copy link
Contributor

Choose a reason for hiding this comment

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

This should remain asobject_name, as you currently have it.

@lovelydinosaurlovelydinosaur added this to the3.4.1 Release milestoneJul 26, 2016
@lovelydinosaur
Copy link
Contributor

Closes#4300.

@lovelydinosaurlovelydinosaur merged commitf0f61aa intoencode:masterJul 26, 2016
@lovelydinosaurlovelydinosaur changed the titleuse verbose_name instead of object_name in field_mappingUse verbose_name instead of object_name in error messagesJul 26, 2016
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.4.1 Release

Development

Successfully merging this pull request may close these issues.

3 participants

@sassanh@lovelydinosaur@codecov-io

[8]ページ先頭

©2009-2025 Movatter.jp