Opened 12 months ago

Closed 3 weeks ago

Last modified 3 weeks ago

#35831 closed Cleanup/optimization (fixed)

Include ModelForm and its Meta options in reference docs

Reported by: jernwerber Owned by: Mustafa Pirbhai
Component: Documentation Version:
Severity: Normal Keywords:
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

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 (17)

comment:1 by jernwerber, 12 months ago

Owner: set to jernwerber
Status: newassigned

comment:2 by Clifford Gama, 11 months ago

Triage Stage: UnreviewedAccepted

Hi @jernwerber, and thanks for taking the time to create this ticket.

I agree. The reference for ModelForm and the Meta 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.

Last edited 11 months ago by Clifford Gama (previous) (diff)

comment:3 by Clifford Gama, 11 months ago

Summary: Reference page for ModelForm Meta and ModelFormOptionsInclude ModelForm and its Meta options in reference docs

in reply to:  2 comment:4 by jernwerber, 11 months 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?

Replying to Clifford Gama:

Hi @jernwerber, and thanks for taking the time to create this ticket.

I agree. The reference for ModelForm and the Meta 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.

Version 0, edited 11 months ago by jernwerber (next)

comment:5 by jernwerber, 11 months 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 Clifford Gama, 11 months ago

Patch needs improvement: set

comment:7 by jernwerber, 11 months ago

Patch needs improvement: unset

comment:8 by Sarah Boyce, 9 months ago

Patch needs improvement: set

comment:9 by Mustafa Pirbhai, 4 weeks ago

Patch needs improvement: unset

comment:10 by Mustafa Pirbhai, 4 weeks ago

Hello, just a first attempt at picking up something that needs to be finalized. If on the right track I'll change it over to me. PR

Last edited 4 weeks ago by Mustafa Pirbhai (previous) (diff)

in reply to:  10 comment:11 by Sarah Boyce, 4 weeks ago

Patch needs improvement: set

Replying to Mustafa Pirbhai:

Hello, just a first attempt at picking up something that needs to be finalized. If on the right track I'll change it over to me. PR

It's an the right track, feel free to assign yourself and uncheck patch needs improvement once comments have been addressed

comment:12 by Mustafa Pirbhai, 4 weeks ago

Owner: changed from jernwerber to Mustafa Pirbhai

comment:13 by Mustafa Pirbhai, 4 weeks ago

Owner: Mustafa Pirbhai removed
Patch needs improvement: unset

comment:14 by Mustafa Pirbhai, 4 weeks ago

Owner: set to Mustafa Pirbhai

comment:15 by Sarah Boyce, 4 weeks ago

Triage Stage: AcceptedReady for checkin

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

Resolution: fixed
Status: assignedclosed

In 183fcebf:

Fixed #35831 -- Documented the model form meta API in model form reference docs.

Co-authored-by: Jonathan <3218047+jernwerber@…>
Co-authored-by: Mustafa <117516335+mspirbhai@…>

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

In 16a12a9:

[5.2.x] Fixed #35831 -- Documented the model form meta API in model form reference docs.

Co-authored-by: Jonathan <3218047+jernwerber@…>
Co-authored-by: Mustafa <117516335+mspirbhai@…>

Backport of 183fcebf88aa0762a2e28477f9b24c34341a75f4 from main.

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