Opened 8 years ago

Closed 8 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: master
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: UI/UX:


At ,

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

  • milestone 1.0 deleted
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

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