Yes I agree with others, that this should not be implemented. As I find this too much specific to just your case.
There are many cases, like what if there is some required field which the developer wants to set by themselves and don't want user to edit that (transaction details maybe for a shopping site). You may Inherit a class from modelform and overide the behaviour for your project, buy I dont think this should be included in Django. Best Regards, PARTH PATIL On Wed, 17 Apr 2019, 12:15 pm Harro, <[email protected]> wrote: > 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 [email protected]. > To post to this group, send email to [email protected]. > 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 > <https://groups.google.com/d/msgid/django-developers/a51d1c72-c724-448f-b804-344cb33d176f%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. 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/CAJSC-ifeKKX0zp1F48dm%3DQSRe%2BBds4r4_nM_0fn3ih9CpTVQUw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
