Ticket #10329: get_FOO_display-link.diff
File get_FOO_display-link.diff, 1.5 KB (added by , 16 years ago) |
---|
-
docs/ref/models/fields.txt
136 136 137 137 For each model field that has :attr:`~Field.choices` set, Django will add a 138 138 method to retrieve the human-readable name for the field's current value. See 139 :meth:`~django.db.models.Model.get_FOO_display` in the database API 140 documentation. 139 :meth:`~django.db.models.Model.get_FOO_display`. 141 140 142 141 Finally, note that choices can be any iterable object -- not necessarily a list 143 142 or tuple. This lets you construct choices dynamically. But if you find yourself … … 724 723 725 724 The admin represents this as an ``<input type="text">`` (a single-line input). 726 725 727 Like all : :class:`CharField` subclasses, :class:`URLField` takes the optional726 Like all :class:`CharField` subclasses, :class:`URLField` takes the optional 728 727 :attr:`~CharField.max_length`argument. If you don't specify 729 728 :attr:`~CharField.max_length`, a default of 200 is used. 730 729 -
docs/ref/models/instances.txt
369 369 get_FOO_display() 370 370 ----------------- 371 371 372 .. method:: Model.get_FOO_display() 373 372 374 For every field that has ``choices`` set, the object will have a 373 375 ``get_FOO_display()`` method, where ``FOO`` is the name of the field. This 374 376 method returns the "human-readable" value of the field. For example, in the