Opened 11 years ago

Closed 11 years ago

#21319 closed Cleanup/optimization (fixed)

Document self.fields in forms

Reported by: Daniel Greenfeld Owned by: Vajrasky Kok
Component: Documentation Version: dev
Severity: Normal Keywords: forms
Cc: loic@…, sky.kok@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Instantiated django.forms.Form and django.forms.ModelForm classes have a fields attribute, which is an iterable of the form fields. It's clearly part of the stable API I don't believe it's documented. As it's a critical part of many complex solutions using forms, I think it would be a great addition to the documentation.

Change History (5)

comment:1 by Tim Graham, 11 years ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

Yes, please.

comment:2 by Marc Tamlyn, 11 years ago

While we are there - I've seen a number of people struggle with the difference between form.fields and form.base_fields - we should explain what they are (and why you shouldn't mess around with the latter).

comment:3 by loic84, 11 years ago

Cc: loic@… added

comment:4 by Vajrasky Kok, 11 years ago

Cc: sky.kok@… added
Easy pickings: set
Has patch: set
Owner: changed from nobody to Vajrasky Kok
Status: newassigned
Version: 1.4master

comment:5 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In ea83102d0f0c215ae2bd16a2c8c474ce615bad9a:

Fixed #21319 -- Added documentation for the Form.fields attribute.

Thanks pydanny for the report. Also, added documentation about
base_fields attribute and its difference with fields attribute.

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