Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #3455: added documentation of Model.get_FIELD_display(). Thanks…

…, Ubernostrum.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4625 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 96604fdf8f34a9e51d1f61a8c81ba5ef843b5ee9 1 parent 9f1bf46
Jacob Kaplan-Moss authored February 26, 2007

Showing 1 changed file with 7 additions and 0 deletions. Show diff stats Hide diff stats

  1. 7  docs/model-api.txt
7  docs/model-api.txt
@@ -498,6 +498,13 @@ or outside your model class altogether::
498 498
     class Foo(models.Model):
499 499
         gender = models.CharField(maxlength=1, choices=GENDER_CHOICES)
500 500
 
  501
+For each field on your model which has ``choices`` set, Django will
  502
+add a method to retrieve the human-readable name for the field's
  503
+current value; see `get_FOO_display`_ in the database API
  504
+documentation.
  505
+
  506
+.. _get_FOO_display: ../db_api/#get-foo-display
  507
+
501 508
 Finally, note that choices can be any iterable object -- not necessarily a
502 509
 list or tuple. This lets you construct choices dynamically. But if you find
503 510
 yourself hacking ``choices`` to be dynamic, you're probably better off using

0 notes on commit 96604fd

Please sign in to comment.
Something went wrong with that request. Please try again.