Add list of required fields to ModelForm.
Hi,
We can add a new field to formbase class like 'fields' or 'exclude' called 'required'.
Any field is in that list, must be completed for submitting and validating.
I think it's not so difficult.
How do I can do that with contributing in django?
It's so good if we can impliment that.
Change History
(4)
Type: |
Uncategorized → Cleanup/optimization
|
Cc: |
ahmad added
|
Component: |
Uncategorized → Forms
|
Summary: |
Form required fields → Add list of required fields to ModelForm.
|
Type: |
Cleanup/optimization → New feature
|
Version: |
2.2 → master
|
Resolution: |
→ wontfix
|
Status: |
new → closed
|
Thanks for this ticket, however to make this really useful we should make changes also in
modelform_factory()
and probably add a new parameter toMeta
. I'm going to won't fix this to for reasons described in #17924 and https://code.djangoproject.com/ticket/20000#comment:9. You can achieve this by overriding__init__
and accessself.fields
directly. Please open a thread on the DevelopersMailingList if you don't agree.Related with #22925.