Opened 5 weeks ago
Last modified 8 days ago
#35831 assigned Cleanup/optimization
Include ModelForm and its Meta options in reference docs
Reported by: | jernwerber | Owned by: | jernwerber |
---|---|---|---|
Component: | Documentation | Version: | |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
ModelForm and the use and structure of a Meta inner class to control what it outputs is covered mostly by way of a topic, Creating Forms from Models.
As a developer, it would be helpful to be able to have a consolidated reference for the complete set of possible Meta options (ModelFormOptions) that can be used with a ModelForm's Meta class in a single place, rather than having to infer options from other topics or check the Python source.
Change History (7)
comment:1 by , 5 weeks ago
Owner: | set to |
---|---|
Status: | new → assigned |
follow-up: 4 comment:2 by , 5 weeks ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 5 weeks ago
Summary: | Reference page for ModelForm Meta and ModelFormOptions → Include ModelForm and its Meta options in reference docs |
---|
comment:4 by , 5 weeks ago
Yep, that makes sense. I've structured by going through the possible/valid attributes for ModelFormOptions
and detailing what each would accept/expect and the kinds of errors one might expect to see if something goes wrong.
I wasn't sure where to situate it in the docs since "models.txt" is already taken by the modelform_factory
and modelformset_factory
docs so for now I just put it under its own thing.
I've done a first pass, here: https://github.com/jernwerber/django/blob/docs-modelform-meta/docs/ref/forms/modelform-meta.txt, but before doing some of the formatting (like breaking lines at 80 characters) and making a PR, is there a (non-PR) workflow for this to be reviewed?
EDIT: I've instead submitted this as a draft PR (see comment below).
Replying to Clifford Gama:
Hi @jernwerber, and thanks for taking the time to create this ticket.
I agree. The reference for
ModelForm
and theMeta
options should be here. Although I'm not sure how much we should include there given most of the information is covered in the topic. I think we should start with the signatures, descriptions and the list of Meta options along with what they do.
comment:5 by , 4 weeks ago
Has patch: | set |
---|
I have created a draft PR for these changes: PR
Note: There is still a make
warning because I have not added this to any toctrees. Not sure where it should go since the most relevant location is already taken by another ModelForms topic-- I wasn't sure if I could make the call to move things around.
comment:6 by , 3 weeks ago
Patch needs improvement: | set |
---|
comment:7 by , 8 days ago
Patch needs improvement: | unset |
---|
Hi @jernwerber, and thanks for taking the time to create this ticket.
I agree. The reference for
ModelForm
and theMeta
options should be here. Although I'm not sure how much we should include there given most of the information is covered in the topic. I think we should start with the signatures, descriptions and the list of Meta options along with what they do.