From 5eb81ce44532596ecc1c781d93f3421a467a6206 Mon Sep 17 00:00:00 2001 From: Julen Ruiz Aizpuru Date: Tue, 29 Apr 2014 10:07:57 +0200 Subject: Fixed #22533 -- Added label_suffix parameter to form fields. Fields can now receive the `label_suffix` attribute, which will override a form's `label_suffix`. This enhances the possibility to customize form's `label_suffix`, allowing to use such customizations while using shortcuts such as `{{ form.as_p }}`. Note that the field's own customization can be overridden at runtime by using the `label_prefix` parameter to `BoundField.label_tag()`. Refs #18134. --- docs/ref/forms/api.txt | 21 +++++++++++++-------- docs/ref/forms/fields.txt | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+), 8 deletions(-) (limited to 'docs/ref/forms') diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt index 8a5303710a..950bd3a088 100644 --- a/docs/ref/forms/api.txt +++ b/docs/ref/forms/api.txt @@ -652,8 +652,13 @@ Note that the label suffix is added only if the last character of the label isn't a punctuation character (in English, those are ``.``, ``!``, ``?`` or ``:``). -You can also customize the ``label_suffix`` on a per-field basis using the -``label_suffix`` parameter to :meth:`~django.forms.BoundField.label_tag`. +.. versionadded:: 1.8 + +Fields can also define their own :attr:`~django.forms.Field.label_suffix`. +This will take precedence over :attr:`Form.label_suffix +`. The suffix can also be overridden at runtime +using the ``label_suffix`` parameter to +:meth:`~django.forms.BoundField.label_tag`. Notes on field ordering ~~~~~~~~~~~~~~~~~~~~~~~ @@ -799,12 +804,12 @@ auto-generated label tag. An optional ``attrs`` dictionary may contain additional attributes for the ``