Re: [Django] #10403: provide declarative syntax to define FormSets - including ModelFormSet and InlineFormSet (was: provide declarative syntax to define ModelFormSet and InlineFormSet)

45 views
Skip to first unread message

Django

unread,
Jun 17, 2011, 7:46:46 PM6/17/11
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen | Owner: nobody
Biermans <koen.biermans@…> | Status: new
Type: New | Component: Forms
feature | Severity: Normal
Milestone: | Keywords: formset
Version: SVN | modelformset inlineformset
Resolution: | Has patch: 1
Triage Stage: Design | Needs tests: 1
decision needed | Easy pickings: 0
Needs documentation: 1 |
Patch needs improvement: 1 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by melinath):

* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
* easy: => 0
* keywords: modelformset inlineformset => formset modelformset
inlineformset
* needs_docs: 0 => 1
* ui_ux: => 0


Comment:

Closed #16289 as a duplicate - it proposed essentially the same thing as
this ticket, but included all !FormSets, not just !ModelFormSets. Hence
I'm widening the scope of this a little. (Also marking as needs tests
since the tests in the patch are doctests.)

--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 18, 2011, 4:59:33 AM6/18/11
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen | Owner: nobody
Biermans <koen.biermans@…> | Status: new
Type: New | Component: Forms
feature | Severity: Normal
Milestone: | Keywords: formset
Version: SVN | modelformset inlineformset
Resolution: | Has patch: 1
Triage Stage: Design | Needs tests: 1
decision needed | Easy pickings: 0
Needs documentation: 1 |
Patch needs improvement: 1 |
UI/UX: 0 |
-------------------------------------+-------------------------------------

Comment (by bpeschier):

Ok, so I missed this one O:)

I disagree with the implementation in the patch, no !MetaClass is needed
and just simple additions to the class definitions to make it work, maybe
with the exception of !InlineFormSet. Will attach a patch later on.

--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:4>

Django

unread,
May 27, 2012, 4:28:37 PM5/27/12
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: nobody
<koen.biermans@…> | Status: new
Type: New feature | Version: master
Component: Forms | Resolution:
Severity: Normal | Triage Stage: Design
Keywords: formset | decision needed
modelformset inlineformset | Needs documentation: 1
Has patch: 1 | Patch needs improvement: 1
Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by rasca):

Adding a comment from #16289:

> This would be very useful for a nicer implementation of the formset
derived cbv #16256.
>
> The BaseInlineFormSet? is the only tricky one with the
_get_foreign_key() and the max_num override when fk.unique=True .
>
> I'd also move the defaults (e.g. extra=3) to the BaseFormSet? and make
the factories only pass dict keys whose value isn't None to type().

--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:5>

Django

unread,
Mar 26, 2013, 6:19:54 PM3/26/13
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: nobody
<koen.biermans@…> | Status: new
Type: New feature | Version: master
Component: Forms | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: formset | Needs documentation: 1
modelformset inlineformset | Patch needs improvement: 1
Has patch: 1 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by carljm):

* stage: Design decision needed => Accepted


Comment:

The current factory-function implementation of formsets is unnecessarily
confusing to new users, and unlike anything else in Django. It can also
cause obscure issues with things that should "just work" (see e.g.
http://stackoverflow.com/questions/622982/django-passing-custom-form-
parameters-to-formset/624013#624013). It's ironic that we provide
declarative syntax for things like models and forms where it requires
metaclass magic, but in the case of formsets where a declarative syntax is
a simple matter of normal Python subclassing, we don't :-)

Haven't reviewed the latest patch in depth, but the broad strokes look
correct to me.

--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:6>

Django

unread,
Mar 27, 2015, 10:26:34 AM3/27/15
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: auvipy
<koen.biermans@…> |
Type: New feature | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: formset | Triage Stage: Accepted
modelformset inlineformset |
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by auvipy):

* owner: nobody => auvipy
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:7>

Django

unread,
Oct 11, 2015, 1:06:39 PM10/11/15
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: auvipy
<koen.biermans@…> |
Type: New feature | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: formset | Triage Stage: Accepted
modelformset inlineformset |
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by auvipy):

will restart work on the ticket. the attached patch need some clean up to
work on master. I'm targeting this to be completed before 1.10 features
freeze.

--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:8>

Django

unread,
Nov 18, 2015, 4:23:13 AM11/18/15
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: auvipy
<koen.biermans@…> |
Type: New feature | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: formset | Triage Stage: Accepted
modelformset inlineformset |
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by auvipy):

Replying to [comment:4 bpeschier]:


> Ok, so I missed this one O:)
>
> I disagree with the implementation in the patch, no !MetaClass is needed
and just simple additions to the class definitions to make it work, maybe
with the exception of !InlineFormSet. Will attach a patch later on.

I saw your patch, and willing to implement it cleanly against master
branch with a pull request.

--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:9>

Django

unread,
Nov 18, 2015, 10:04:45 AM11/18/15
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: auvipy
<koen.biermans@…> |
Type: New feature | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: formset | Triage Stage: Accepted
modelformset inlineformset |
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

I don't know that deprecating the factory functions (at least immediately)
is a good idea. This could cause a lot of annoying churn for large
projects.

--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:10>

Django

unread,
Nov 19, 2015, 2:42:57 AM11/19/15
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: auvipy
<koen.biermans@…> |
Type: New feature | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: formset | Triage Stage: Accepted
modelformset inlineformset |
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by auvipy):

Replying to [comment:10 timgraham]:


> I don't know that deprecating the factory functions (at least
immediately) is a good idea. This could cause a lot of annoying churn for
large projects.

Then I should keep them [factory function/s] for this patch in WIP

--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:11>

Django

unread,
May 31, 2019, 10:00:03 AM5/31/19
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: Parth
<koen.biermans@…> | Patil

Type: New feature | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: formset | Triage Stage: Accepted
modelformset inlineformset |
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Parth Patil):

* owner: nobody => Parth Patil


* status: new => assigned

Django

unread,
Jun 17, 2019, 10:47:55 AM6/17/19
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: Parth
<koen.biermans@…> | Patil
Type: New feature | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: formset | Triage Stage: Accepted
modelformset inlineformset |
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Parth Patil):

Here is a link to the pull request. This is the first iteration of the
patch so may require some critical review.
https://github.com/django/django/pull/11481

--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:12>

Django

unread,
Mar 19, 2020, 7:40:57 AM3/19/20
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: Parth
<koen.biermans@…> | Patil
Type: New feature | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: formset | Triage Stage: Accepted
modelformset inlineformset |
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Asif Saifuddin Auvi):

Parth, are you willing to complete this for 3.1?

--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:13>

Django

unread,
Jan 24, 2024, 11:11:00 AM1/24/24
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: Mitchina
<koen.biermans@…> |

Type: New feature | Status: assigned
Component: Forms | Version: dev

Severity: Normal | Resolution:
Keywords: formset | Triage Stage: Accepted
modelformset inlineformset |
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mitchina):

* owner: Parth Patil => Mitchina

--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:14>

Django

unread,
Feb 25, 2024, 1:46:29 AM2/25/24
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: Mitchina
<koen.biermans@…> |
Type: New feature | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: formset | Triage Stage: Accepted
modelformset inlineformset |
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mitchina):

I opened a PR (still in draft) to continue the work initiated by Parth
Patil on: https://github.com/django/django/pull/17905
--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:15>

Django

unread,
Mar 3, 2024, 7:17:46 PM3/3/24
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: Mitchina
<koen.biermans@…> |
Type: New feature | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: formset | Triage Stage: Accepted
modelformset inlineformset |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mitchina):

* needs_better_patch: 1 => 0
* needs_docs: 1 => 0
* needs_tests: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:16>

Django

unread,
May 3, 2024, 4:47:44 AM5/3/24
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: Mitchina
<koen.biermans@…> |
Type: New feature | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: formset | Triage Stage: Accepted
modelformset inlineformset |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

Comment:

Left a small review, please update "Patch needs improvement" to False when
these changes are applied and I will review more deeply 👍
--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:17>

Django

unread,
Oct 8, 2025, 5:40:08 PM10/8/25
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: Mitchina
<koen.biermans@…> |
Type: New feature | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: formset | Triage Stage: Accepted
modelformset inlineformset |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Anthony Addae):

Hello!

I am a participant in Djangonaut Space Session 5 and I'd love to take on
this ticket as part of my contribution to the Django project.

I have reviewed the ticket details and the current discussion, and I
believe I have a clear path to resolving the review comments.

Could I please assign this ticket to myself? Thank you.
--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:18>

Django

unread,
Oct 9, 2025, 3:41:21 PM10/9/25
to django-...@googlegroups.com
#10403: provide declarative syntax to define FormSets - including ModelFormSet and
InlineFormSet
-------------------------------------+-------------------------------------
Reporter: Koen Biermans | Owner: Anthony
<koen.biermans@…> | Addae
Type: New feature | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: formset | Triage Stage: Accepted
modelformset inlineformset |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Anthony Addae):

* owner: Mitchina => Anthony Addae

--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:19>
Reply all
Reply to author
Forward
0 new messages