Opened 16 years ago

Closed 16 years ago

Last modified 16 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: 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)

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

Download all attachments as: .zip

Change History (14)

comment:1 by Karen Tracey, 16 years ago

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 by Malcolm Tredinnick, 16 years ago

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 by Ramiro Morales, 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.

comment:4 by Karen Tracey, 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.)

in reply to:  4 comment:5 by Ramiro Morales, 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 yoz, 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 Kyle Dodson, 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 Tim Graham, 16 years ago

Owner: changed from nobody to Tim Graham
Status: newassigned

by Tim Graham, 16 years ago

Attachment: verbose_field_doc.diff added

initial patch

comment:9 by Tim Graham, 16 years ago

Has patch: set

comment:10 by anonymous, 16 years ago

Triage Stage: AcceptedReady for checkin

comment:11 by Russell Keith-Magee, 16 years ago

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 by Russell Keith-Magee, 16 years ago

(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 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

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