Opened 16 years ago

Closed 16 years ago

#8470 closed (wontfix)

Documentation for verbose field names could suggest a DRY way to define verbose_name for foreign keys

Reported by: amiroff Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords: verbose_name foreign key, foreign_key, ForeignKey
Cc: amiroff@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

At http://www.djangoproject.com/documentation/model-api/#verbose-field-names ,

Documentation states that we can use the following:

poll = models.ForeignKey(Poll, verbose_name="the related poll")

If you already have verbose_name defined under Meta class of Poll object, this way of defining it twice does not obey DRY principle.
In this case using the following way to specify verbose_name would improve the documentation:

poll = models.ForeignKey(Poll, verbose_name=Poll._meta.verbose_name)

Change History (1)

comment:1 by Malcolm Tredinnick, 16 years ago

milestone: 1.0
Resolution: wontfix
Status: newclosed

Things in _meta are not part of the public API and may change in the future, so this wouldn't be a good recommendation.

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