I'm against, there are lots of cases where a modelform is used to edit an exitsting object and thus the required fields are already set and you don't want them to be editable.
If it's a trivial patch then you should think about extending modelform in your own project enforce it there and then use it instead of the normal modelform. I also think a good test setup/protocol will catch missing fields pretty quickly as you won't be able to actually create the object. On Wednesday, 17 April 2019 02:34:12 UTC+2, Will Gordon wrote: > > In the same way that editable fields are forced to not be included in a > ModelForm ( > https://github.com/django/django/blob/master/django/forms/models.py#L146), > I would like to propose that "required" fields (`blank=False`) be forced to > be included in a ModelForm. > > While I understand that a developer can force this inclusion themselves, > but on a large project, it should not be necessary to always ensure that a > Model and ModelForm are in sync. > > Since this is probably a non-trivial patch ( > https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/submitting-patches/#non-trivial-patches) > > I need to provide evidence that this has been discussed. As such, I'm open > to any and all opinions! > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/a51d1c72-c724-448f-b804-344cb33d176f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.