#18549 closed Bug (fixed)
Admin should not use verbose_name_plural for OneToOne field
Reported by: | Roy Smith | Owned by: | Tim McCurrach |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | harph, 4glitch@… | 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 ¶
Do something like the following:
class Foo(Model): i = IntegerField() bar = OneToOneField("Bar") class FooInline(admin.TabularInline): model = Foo class Bar(Model): i = Integerfield() class BarAdmin(admin.ModelAdmin): inlines = [FooInline] admin.site.register(Foo, FooAdmin) admin.site.register(Bar)
When you edit a Bar in the admin, the formset section for entering a Foo will be labeled "Foos" (plural). Since it's a one-to-one mapping, it should be labeled "Foo" (singular).
Change History (17)
comment:1 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 12 years ago
Owner: | changed from | to
---|
by , 12 years ago
Attachment: | 18549.diff added |
---|
comment:3 by , 12 years ago
Has patch: | set |
---|---|
Version: | 1.4 → master |
comment:4 by , 12 years ago
Cc: | added |
---|
comment:5 by , 12 years ago
I submitted a pull request. This is the url: https://github.com/django/django/pull/498
comment:6 by , 12 years ago
Note that you are hard-coding usage of plural for 0 items, which is not true for all languages. However, I'm not sure there is a better solution i18n-wise (as using blocktrans will only partially solve it and add a non-sense translatable string to po files).
comment:7 by , 12 years ago
Cc: | added |
---|
comment:8 by , 11 years ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
This needs tests, ideally adding max_num=1
to an existing tabular and stacked inline and verifying the <h2> text. The existing patch also causes some test failures due to the added whitespace.
comment:9 by , 4 years ago
Status: | new → assigned |
---|
comment:10 by , 4 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:11 by , 4 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:12 by , 4 years ago
Needs tests: | unset |
---|---|
Patch needs improvement: | unset |
comment:13 by , 4 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Fixed adding two conditions to the stacked.html and tabular.html templates.