Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#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)

9wgvVRd.png (138.4 KB ) - added by Zowie Beha 5 months ago.
The subject label has the suffix ':', while label_suffix sets it to ' ->'

Download all attachments as: .zip

Change History (10)

by Zowie Beha, 5 months ago

Attachment: 9wgvVRd.png added

The subject label has the suffix ':', while label_suffix sets it to ' ->'

comment:1 by Zowie Beha, 5 months ago

Component: UncategorizedDocumentation

comment:2 by Zowie Beha, 5 months ago

Cc: Zowie Beha added

comment:3 by Zowie Beha, 5 months ago

Summary: Form documentation example has incorrect outputForm docs label_suffix example has incorrect output

comment:4 by Mariusz Felisiak, 5 months ago

Summary: Form docs label_suffix example has incorrect outputTypo in Form.label_suffix example in docs.
Triage Stage: UnreviewedAccepted

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  
    909909    <div><label for="id_for_cc_myself">Cc myself</label><input type="checkbox" name="cc_myself" id="id_for_cc_myself"></div>
    910910    >>> f = ContactForm(auto_id="id_for_%s", label_suffix=" ->")
    911911    >>> 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 -&gt;</label><input type="text" name="subject" maxlength="100" required id="id_for_subject"></div>
    913913    <div><label for="id_for_message">Message -&gt;</label><textarea name="message" cols="40" rows="10" required id="id_for_message"></textarea></div>
    914914    <div><label for="id_for_sender">Sender -&gt;</label><input type="email" name="sender" required id="id_for_sender"></div>
    915915    <div><label for="id_for_cc_myself">Cc myself -&gt;</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 Salvo Polizzi, 5 months ago

Has patch: set
Owner: changed from nobody to Salvo Polizzi
Status: newassigned

comment:6 by Mariusz Felisiak, 5 months ago

Triage Stage: AcceptedReady for checkin

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 5 months ago

Resolution: fixed
Status: assignedclosed

In dc26a3d5:

Fixed #35069 -- Fixed typo in docs/ref/forms/api.txt.

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 5 months ago

In c69dbc7c:

[5.0.x] Fixed #35069 -- Fixed typo in docs/ref/forms/api.txt.

Backport of dc26a3d563b1e1d98d40f5d351a6a61c34f12d98 from main

in reply to:  4 comment:9 by Zowie Beha, 5 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  
    909909    <div><label for="id_for_cc_myself">Cc myself</label><input type="checkbox" name="cc_myself" id="id_for_cc_myself"></div>
    910910    >>> f = ContactForm(auto_id="id_for_%s", label_suffix=" ->")
    911911    >>> 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 -&gt;</label><input type="text" name="subject" maxlength="100" required id="id_for_subject"></div>
    913913    <div><label for="id_for_message">Message -&gt;</label><textarea name="message" cols="40" rows="10" required id="id_for_message"></textarea></div>
    914914    <div><label for="id_for_sender">Sender -&gt;</label><input type="email" name="sender" required id="id_for_sender"></div>
    915915    <div><label for="id_for_cc_myself">Cc myself -&gt;</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

Note: See TracTickets for help on using tickets.
Back to Top