Opened 4 years ago
Closed 3 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 , 4 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
follow-up: 3 comment:2 by , 4 years ago
comment:3 by , 4 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 , 4 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 , 4 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 , 4 years ago
Added
- The default
verbose_name_plural
for an
InlineModelAdmin
(sub-)class is now its
verbose_name + 's'
if the
verbose_name
is specified in that
InlineModelAdmin
(sub-)class, instead of being the
verbose_name_plural
for the model class.
under the django.contrib.admin heading in the "Backwards incompatible changes in 3.2" section of the version 3.2 release notes.
comment:7 by , 4 years ago
Needs documentation: | unset |
---|
comment:9 by , 4 years ago
Patch needs improvement: | set |
---|
comment:11 by , 3 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 , 3 years ago
Patch needs improvement: | set |
---|
comment:14 by , 3 years ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Please push your patch as a Django pull request.