Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#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: UI/UX:

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)

verbose_field_doc.diff (1.0 KB) - added by Tim Graham 8 years ago.
initial patch

Download all attachments as: .zip

Change History (14)

comment:1 Changed 8 years ago by Karen Tracey

Triage Stage: UnreviewedDesign decision needed

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.

comment:2 Changed 8 years ago by Malcolm Tredinnick

Triage Stage: Design decision neededAccepted

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 Changed 8 years ago by Ramiro Morales

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.

comment:4 Changed 8 years ago by Karen Tracey

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 in reply to:  4 Changed 8 years ago by Ramiro Morales

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 Changed 8 years ago by yoz

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 Changed 8 years ago by Kyle Dodson

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 Changed 8 years ago by Tim Graham

Owner: changed from nobody to Tim Graham
Status: newassigned

Changed 8 years ago by Tim Graham

Attachment: verbose_field_doc.diff added

initial patch

comment:9 Changed 8 years ago by Tim Graham

Has patch: set

comment:10 Changed 8 years ago by anonymous

Triage Stage: AcceptedReady for checkin

comment:11 Changed 8 years ago by Russell Keith-Magee

Resolution: fixed
Status: assignedclosed

(In [9865]) Fixed #9347 -- Added an entry in the field reference for the verbose_name option. Thanks to marcoberi for the suggestion, and timo for the eventual patch.

comment:12 Changed 8 years ago by Russell Keith-Magee

(In [9875]) [1.0.X] Fixed #9347 -- Added an entry in the field reference for the verbose_name option. Thanks to marcoberi for the suggestion, and timo for the eventual patch.

Merge of r9865 from trunk.

comment:13 Changed 8 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top