#35069 closed Cleanup/optimization (fixed)
Typo in Form.label_suffix example in docs.
Reported by: | Zowie Beha | Owned by: | Salvo Polizzi |
---|---|---|---|
Component: | Documentation | Version: | 5.0 |
Severity: | Normal | Keywords: | form, documentation |
Cc: | Zowie Beha | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
https://docs.djangoproject.com/en/5.0/ref/forms/api/#django.forms.Form.label_suffix
https://i.imgur.com/9wgvVRd.png
Hi everyone,
in this example, a form is created with the label_suffix set to " ->". When this form is printed, the output shows that the Subject label does not reflect this change. This leads me to think this line may be a mistake.
Attachments (1)
Change History (10)
by , 11 months ago
Attachment: | 9wgvVRd.png added |
---|
comment:1 by , 11 months ago
Component: | Uncategorized → Documentation |
---|
comment:2 by , 11 months ago
Cc: | added |
---|
comment:3 by , 11 months ago
Summary: | Form documentation example has incorrect output → Form docs label_suffix example has incorrect output |
---|
follow-up: 9 comment:4 by , 11 months ago
Summary: | Form docs label_suffix example has incorrect output → Typo in Form.label_suffix example in docs. |
---|---|
Triage Stage: | Unreviewed → Accepted |
Good catch, it looks like a typo in the 9ac97e7eb5a74f813012715c7598c8608e78e178:
-
docs/ref/forms/api.txt
diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt index 7bec9b120b..28cd452c4e 100644
a b It's possible to customize that character, or omit it entirely, using the 909 909 <div><label for="id_for_cc_myself">Cc myself</label><input type="checkbox" name="cc_myself" id="id_for_cc_myself"></div> 910 910 >>> f = ContactForm(auto_id="id_for_%s", label_suffix=" ->") 911 911 >>> print(f) 912 <div><label for="id_for_subject">Subject :</label><input type="text" name="subject" maxlength="100" required id="id_for_subject"></div>912 <div><label for="id_for_subject">Subject -></label><input type="text" name="subject" maxlength="100" required id="id_for_subject"></div> 913 913 <div><label for="id_for_message">Message -></label><textarea name="message" cols="40" rows="10" required id="id_for_message"></textarea></div> 914 914 <div><label for="id_for_sender">Sender -></label><input type="email" name="sender" required id="id_for_sender"></div> 915 915 <div><label for="id_for_cc_myself">Cc myself -></label><input type="checkbox" name="cc_myself" id="id_for_cc_myself"></div>
Would you like to prepare a patch (via GitHub PR)?
For the future, tickets are not necessary to fix typos in docs.
comment:5 by , 11 months ago
Has patch: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:6 by , 11 months ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:9 by , 11 months ago
Replying to Mariusz Felisiak:
Good catch, it looks like a typo in the 9ac97e7eb5a74f813012715c7598c8608e78e178:
docs/ref/forms/api.txt
diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt index 7bec9b120b..28cd452c4e 100644
a b It's possible to customize that character, or omit it entirely, using the 909 909 <div><label for="id_for_cc_myself">Cc myself</label><input type="checkbox" name="cc_myself" id="id_for_cc_myself"></div> 910 910 >>> f = ContactForm(auto_id="id_for_%s", label_suffix=" ->") 911 911 >>> print(f) 912 <div><label for="id_for_subject">Subject :</label><input type="text" name="subject" maxlength="100" required id="id_for_subject"></div>912 <div><label for="id_for_subject">Subject -></label><input type="text" name="subject" maxlength="100" required id="id_for_subject"></div> 913 913 <div><label for="id_for_message">Message -></label><textarea name="message" cols="40" rows="10" required id="id_for_message"></textarea></div> 914 914 <div><label for="id_for_sender">Sender -></label><input type="email" name="sender" required id="id_for_sender"></div> 915 915 <div><label for="id_for_cc_myself">Cc myself -></label><input type="checkbox" name="cc_myself" id="id_for_cc_myself"></div> Would you like to prepare a patch (via GitHub PR)?
For the future, tickets are not necessary to fix typos in docs.
Thanks for the info! It looks like someone else got it; but really I just made it to help someone get a patch in
The subject label has the suffix ':', while label_suffix sets it to ' ->'