From 991432ee8ab49eca76113f0b6c23e885ea316507 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Fri, 12 Apr 2013 10:13:38 +0200 Subject: [PATCH] [1.5.x] Documented BoundField.label_tag Backport of 0f99246b6 from master. --- docs/ref/forms/api.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt index d1f877ff657..8d9e43bd3b8 100644 --- a/docs/ref/forms/api.txt +++ b/docs/ref/forms/api.txt @@ -638,6 +638,19 @@ For a field's list of errors, access the field's ``errors`` attribute. >>> str(f['subject'].errors) '' +.. method:: BoundField.label_tag(contents=None, attrs=None) + +To separately render the label tag of a form field, you can call its +``label_tag`` method:: + + >>> f = ContactForm(data) + >>> print(f['message'].label_tag()) + + +Optionally, you can provide the ``contents`` parameter which will replace the +auto-generated label tag. An optional ``attrs`` dictionary may contain +additional attributes for the ``