diff options
| author | Tim Graham <timograham@gmail.com> | 2013-07-06 18:31:59 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-07-06 18:34:43 -0400 |
| commit | 80673e20f212fbefd1a8d53ae521e95c6eedf201 (patch) | |
| tree | 1ee57a81c978460702cdd58103bdf13c0c1ec7c2 | |
| parent | 6c984587711f82c0fc5223bbf6e8bb3b71732a3e (diff) | |
[1.5.x] Fixed #14006 -- Documented that Field's 'description' attribute is interpolated with field.__dict__
Thanks abeld for the suggestion.
Backport of 2d96e660f9 from master.
| -rw-r--r-- | docs/howto/custom-model-fields.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/howto/custom-model-fields.txt b/docs/howto/custom-model-fields.txt index 54f2da7a1d..e87d4f78b3 100644 --- a/docs/howto/custom-model-fields.txt +++ b/docs/howto/custom-model-fields.txt @@ -314,6 +314,13 @@ descriptive text in a ``description`` class attribute of your custom field. In the above example, the description displayed by the ``admindocs`` application for a ``HandField`` will be 'A hand of cards (bridge style)'. +In the :mod:`django.contrib.admindocs` display, the field description is +interpolated with ``field.__dict__`` which allows the description to +incorporate arguments of the field. For example, the description for +:class:`~django.db.models.CharField` is:: + + description = _("String (up to %(max_length)s)") + Useful methods -------------- |
