From 584bd14dcfdee9585fec7794d53ce120ea73d0bc Mon Sep 17 00:00:00 2001 From: Gabe Jackson Date: Fri, 8 Jun 2012 15:32:35 +0200 Subject: Fixed #18134 -- BoundField.label_tag now includes the form's label_suffix There was an inconsistency between how the label_tag for forms were generated depending on which method was used: as_p, as_ul and as_table contained code to append the label_suffix where as label_tag called on a form field directly did NOT append the label_suffix. The code for appending the label_suffix has been moved in to the label_tag code of the field and the HTML generation code for as_p, as_ul and as_table now calls this code as well. This is a backwards incompatible change because users who have added the label_suffix manually in their templates may now get double label_suffix characters in their forms. --- docs/topics/forms/index.txt | 16 +++++++++++----- docs/topics/forms/modelforms.txt | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'docs/topics/forms') diff --git a/docs/topics/forms/index.txt b/docs/topics/forms/index.txt index ac58acc9e3..7d5a0ed411 100644 --- a/docs/topics/forms/index.txt +++ b/docs/topics/forms/index.txt @@ -302,7 +302,7 @@ loop:: {% for field in form %}
{{ field.errors }} - {{ field.label_tag }}: {{ field }} + {{ field.label_tag }} {{ field }}
{% endfor %}

@@ -316,8 +316,14 @@ attributes, which can be useful in your templates: The label of the field, e.g. ``Email address``. ``{{ field.label_tag }}`` - The field's label wrapped in the appropriate HTML ``