#9347 closed (fixed)
verbose_name option is missing in Model Field reference
Reported by: | marcoberi | Owned by: | Tim Graham |
---|---|---|---|
Component: | Documentation | Version: | 1.0 |
Severity: | Keywords: | ||
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
Below this option http://docs.djangoproject.com/en/dev/ref/models/fields/#unique-for-year I would put also verbose_name one.
Attachments (1)
Change History (14)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 16 years ago
Triage Stage: | Design decision needed → Accepted |
---|
We can add a reference for this and then point to the current description. The reference section (ref/
directory) isn't really a complete reference if it's missing options. We don't have to duplicate the description, since inter-file linking is possible.
comment:3 by , 16 years ago
Actually, AFAIK, normal field types do not have a verbose_name
option (it's only set using the first positional parameter of the model field declaration) but relationship fields do.
From the documentation location the OT suggests it seems he wants to add a blurb/link to the wrong place, if anything it should be added to the http://docs.djangoproject.com/en/dev/ref/models/fields/#module-django.db.models.fields.related section further down in the same document.
follow-up: 5 comment:4 by , 16 years ago
Any field can have a verbose_name specified. Not sure why you think it is restricted to relationship fields? The difference between specifying it for non-related and related is you may simply specify it as the first positional argument for any field that is not a ForeignKey, ManyToManyField or OneToOneField; that is you are not required to use the verbose_name keyword. But you certainly can. (The reason you cannot specify it as first positional for the others is that they require different first positional arguments, so for them you must use the verbose_name keyword if you want to specify it at all.)
comment:5 by , 16 years ago
Karen,
Replying to kmtracey:
Any field can have a verbose_name specified. Not sure why you think it is restricted to relationship fields? The difference between specifying it for non-related and related is you may simply specify it as the first positional argument for any field that is not a ForeignKey, ManyToManyField or OneToOneField; that is you are not required to use the verbose_name keyword. But you certainly can.
It' because the wording used here: http://docs.djangoproject.com/en/dev/topics/db/models/#verbose-field-names
I know that, strictly speaking, that section doesn't say normal fields don't support verbose_name
but it only mentions they support usage of the first positional argument and contrast them agains the relationship fields. I hadn't looked up at the code that's why I wrote AFAIK
.
comment:6 by , 16 years ago
Speaking as someone who just wasted half an hour looking for the functionality offered by verbose_name, and who pored through the model field reference multiple times, I strongly endorse this ticket.
comment:7 by , 16 years ago
Another vote for a fix. I'm new to Django, and the first place I went was http://docs.djangoproject.com/en/dev/ref/models/fields/. I was beginning to think it couldn't be done until I stumbled across this ticket.
comment:8 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:9 by , 16 years ago
Has patch: | set |
---|
comment:10 by , 16 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:11 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
The verbose_name keyword argument for model fields is described in 'Writing Models' here:
http://docs.djangoproject.com/en/dev/topics/db/models/#verbose-field-names
I do not know that we want to (or generally do?) document things in two places. Someone more involved with the documentation structure needs to make that call.