Opened 13 months ago

Closed 10 months ago

Last modified 10 months ago

#28761 closed Cleanup/optimization (fixed)

Document prefixes in InlineFormsets

Reported by: Jay Welborn Owned by: Jay Welborn
Component: Documentation Version: 1.11
Severity: Normal Keywords: InlineFormsets
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

When using inlineformset_factory to create an Inline Formset, django sets the formset's prefix to the related name from the child model. The Inline Formset topic guide doesn't mention this.

I struggled with this trying to test an InlineFormset, and I'd like to add an example to the documentation to clarify this behavior. If this is something the community wants, I'll write the example and send a PR.

Change History (15)

comment:1 Changed 13 months ago by Jay Welborn

Type: UncategorizedCleanup/optimization

comment:2 Changed 13 months ago by Tim Graham

Summary: Documentation doesn't cover prefixes in InlineFormsetsDocument prefixes in InlineFormsets
Triage Stage: UnreviewedAccepted

comment:3 Changed 13 months ago by Jay Welborn

Last edited 13 months ago by Jay Welborn (previous) (diff)

comment:4 Changed 13 months ago by Jay Welborn

Has patch: set

Opened PR #9320

Last edited 13 months ago by Jay Welborn (previous) (diff)

comment:5 Changed 12 months ago by Tim Martin

Patch needs improvement: set

This looks good, thanks for documenting. I added one (and a half!) comments on the pull request.

comment:6 Changed 12 months ago by Jay Welborn

Thanks for reviewing this. I agree printing the formset looked messy, so I've updated the PR

comment:7 Changed 12 months ago by Tim Martin

Patch needs improvement: unset

Since you've addressed my comments, I think it's correct to remove the "patch needs improvement" flag so that it's visible in the reports. I'll re-review now.

comment:8 Changed 12 months ago by Tim Martin

Triage Stage: AcceptedReady for checkin

Looks good to me. The two commits will need to be squashed into a single commit that follows the guidelines for commit messages.

comment:9 Changed 12 months ago by Jay Welborn

I squashed my commits, but now I'm failing one of the automated checks. Not exactly sure why, and I'm not super familiar with Jenkins.

If there's anything I can do on my end to fix it let me know.

comment:10 Changed 10 months ago by Tim Graham

Triage Stage: Ready for checkinAccepted

The latest version of the patch hasn't been reviewed yet.

comment:11 Changed 10 months ago by Carlton Gibson

Patch looks good. It's just lacking an addition to AUTHORS (and query the CLA submission).

comment:12 Changed 10 months ago by Carlton Gibson

Patch needs improvement: set

comment:13 Changed 10 months ago by Carlton Gibson

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

Clearing the "Patch needs improvement" to not block on the AUTHOR edit and CLA submission.

comment:14 Changed 10 months ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 56e590cc:

Fixed #28761 -- Documented how an inline formset's prefix works.

comment:15 Changed 10 months ago by Tim Graham <timograham@…>

In e5acbbe:

[2.0.x] Fixed #28761 -- Documented how an inline formset's prefix works.

Backport of 56e590cc0be4d8c8b6fe0967583a6e02d18ee03e from master

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