Opened 5 years ago
Closed 4 years ago
#32219 closed New feature (fixed)
Use Admin Inline verbose_name as default for Inline verbose_name_plural
| Reported by: | Siburg | Owned by: | Siburg |
|---|---|---|---|
| Component: | contrib.admin | Version: | 4.0 |
| Severity: | Normal | Keywords: | Admin Inline verbose_name_plural |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Django allows specification of a verbose_name and a verbose_name_plural for Inline classes in admin views. However, verbose_name_plural for an Inline is not currently based on a specified verbose_name. Instead, it continues to be based on the model name, or an a verbose_name specified in the model's Meta class. This was confusing to me initially (I didn't understand why I had to specify both name forms for an Inline if I wanted to overrule the default name), and seems inconsistent with the approach for a model's Meta class (which does automatically base the plural form on a specified verbose_name). I propose that verbose_name_plural for an Inline class should by default be based on the verbose_name for an Inline if that is specified.
I have written a patch to implement this, including tests. Would be happy to submit that.
Change History (15)
comment:1 by , 5 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
follow-up: 3 comment:2 by , 5 years ago
comment:3 by , 5 years ago
Replying to Claude Paroz:
Please push your patch as a Django pull request.
Pull request is here: https://github.com/django/django/pull/13710
Does not yet contain documentation updates because I'm not sure where those should go. Failed the isort test because I did not change existing order of imports. Would be happy to make that change.
comment:4 by , 5 years ago
Responded to code review comment, and changed the import ordering and formatting while I was at it so it now passes the isort test as well.
comment:5 by , 5 years ago
| Needs documentation: | set |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
Sounds reasonable, thanks. Docs changes are missing, e.g. a release note about backwards incompatibility
comment:6 by , 5 years ago
Added
- The default
verbose_name_pluralfor anInlineModelAdmin(sub-)class is now itsverbose_name + 's'if theverbose_nameis specified in thatInlineModelAdmin(sub-)class, instead of being theverbose_name_pluralfor the model class.
under the django.contrib.admin heading in the "Backwards incompatible changes in 3.2" of the version 3.2 release notes.
comment:7 by , 5 years ago
| Needs documentation: | unset |
|---|
comment:9 by , 5 years ago
| Patch needs improvement: | set |
|---|
comment:11 by , 4 years ago
| Patch needs improvement: | unset |
|---|---|
| Version: | 3.1 → 4.0 |
Updated documentation to reflect anticipated inclusion in version 4.0, added a versionchanged block and included links in the documentation.
comment:12 by , 4 years ago
| Patch needs improvement: | set |
|---|
comment:14 by , 4 years ago
| Patch needs improvement: | unset |
|---|---|
| Triage Stage: | Accepted → Ready for checkin |
Please push your patch as a Django pull request.