Django

Code

Changeset 4625

Show
Ignore:
Timestamp:
02/26/07 15:40:15 (2 years ago)
Author:
jacob
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/model-api.txt

    r4596 r4625  
    498498    class Foo(models.Model): 
    499499        gender = models.CharField(maxlength=1, choices=GENDER_CHOICES) 
     500 
     501For each field on your model which has ``choices`` set, Django will 
     502add a method to retrieve the human-readable name for the field's 
     503current value; see `get_FOO_display`_ in the database API 
     504documentation. 
     505 
     506.. _get_FOO_display: ../db_api/#get-foo-display 
    500507 
    501508Finally, note that choices can be any iterable object -- not necessarily a