Opened 5 years ago

Closed 5 years ago

#30789 closed New feature (wontfix)

Add list of required fields to ModelForm.

Reported by: ahmad Owned by: nobody
Component: Forms Version: dev
Severity: Normal Keywords:
Cc: ahmad Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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)

comment:1 by ahmad, 5 years ago

Type: UncategorizedCleanup/optimization

comment:2 by ahmad, 5 years ago

Cc: ahmad added
Component: UncategorizedForms

comment:3 by Mariusz Felisiak, 5 years ago

Summary: Form required fieldsAdd list of required fields to ModelForm.
Type: Cleanup/optimizationNew feature
Version: 2.2master

Thanks for this ticket, however to make this really useful we should make changes also in modelform_factory() and probably add a new parameter to Meta. 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 access self.fields directly. Please open a thread on the DevelopersMailingList if you don't agree.

Related with #22925.

comment:4 by Mariusz Felisiak, 5 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top