#29956: Allow formset form widget override for the ORDER field
------------------------------+------------------------------------------
Reporter: Claude Paroz | Owner: Hasan Ramezani
Type: New feature | Status: assigned
Component: Forms | Version: 2.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------------
Comment (by Hasan Ramezani):
Here is the summary of conversation between me and @claudep on the
[https://github.com/django/django/pull/10660#issuecomment-440327124 PR] :
I did this feature by adding the `order_field_widget` to `formset_factory`
functions. (now available in the PR)
@claudep suggested managing this by adding a key in `widgets` property of
`ModelForm`. something like this:
{{{
class AuthorForm(ModelForm):
class Meta:
model = Author
fields = ('name', 'title', 'birth_date')
widgets = {
'ORDER': HiddenInput(),
}
}}}
It works for `ModelForm` because we can access the `widgets` property of
ModelForm by : `model_form._meta.widgets`.
But it is possible to have this feature for `formset` which generated by
the normal forms, because the normal form that inherits from `forms.Form`
has not the `widgets` property.
So @claudep suggest to first add this feature just for ModelForm.
what is the final decision?
--
Ticket URL: <https://code.djangoproject.com/ticket/29956#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.c2b93444e8eac83f5d6b95dd1c16c286%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.