#35871: Example changes that show the impact of alter the base_fields attribute.
--------------------------------+-----------------------------------------
Reporter: Antoliny | Type: Uncategorized
Status: new | Component: Documentation
Version: 5.0 | Severity: Normal
Keywords: Forms Document | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+-----------------------------------------
There is an example of the impact of changing the attribute of base_fields
in the
[
https://docs.djangoproject.com/en/5.1/ref/forms/api/#django.forms.Form.fields
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">'
}}}
--
Ticket URL: <
https://code.djangoproject.com/ticket/35871>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.