Opened 3 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#35871 closed Cleanup/optimization (fixed)

Example changes that show the impact of alter the base_fields attribute.

Reported by: Antoliny Owned by: Antoliny
Component: Documentation Version: 5.0
Severity: Normal Keywords: Forms Document
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

There is an example of the impact of changing the attribute of base_fields in the forms api document.

According to the above document, I think we need to show the impact on subsequent ContactForm when we change the base_fields attribute as an example of ContactForm.

>>> f.base_fields["subject"].label_suffix = "?"
>>> another_f = ContactForm(auto_id=False)
>>> another_f.as_div().split("</div>")[0]
'<div><label for="id_subject">Subject?</label><input type="text" name="subject" maxlength="100" required id="id_subject">'

Change History (7)

comment:1 by Antoliny, 3 weeks ago

Owner: set to Antoliny
Status: newassigned

comment:2 by Antoliny, 3 weeks ago

Has patch: set

comment:3 by Antoliny, 3 weeks ago

comment:4 by Sarah Boyce, 3 weeks ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:5 by Sarah Boyce, 3 weeks ago

Triage Stage: AcceptedReady for checkin

comment:6 by Sarah Boyce <42296566+sarahboyce@…>, 3 weeks ago

Resolution: fixed
Status: assignedclosed

In 738e0601:

Fixed #35871 -- Corrected example on altering the base_fields attribute in forms docs.

comment:7 by Sarah Boyce <42296566+sarahboyce@…>, 3 weeks ago

In a0ea554d:

[5.1.x] Fixed #35871 -- Corrected example on altering the base_fields attribute in forms docs.

Backport of 738e0601d597d4b6bee0000f645994495af984d8 from main.

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