* 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.
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>
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>
* 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>
* owner: nobody => auvipy
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:7>
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>
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>
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>
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>
* owner: nobody => Parth Patil
* status: new => assigned
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>
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>
* owner: Parth Patil => Mitchina
--
Ticket URL: <https://code.djangoproject.com/ticket/10403#comment:14>