#30831: Django doesn't respect overriding the maxlength widget attribute for
CharFields in ModelForm.
---------------------------------+--------------------------------------
     Reporter:  Arsenal591       |                    Owner:  nobody
         Type:  Bug              |                   Status:  closed
    Component:  Forms            |                  Version:  2.2
     Severity:  Normal           |               Resolution:  invalid
     Keywords:  form, modelform  |             Triage Stage:  Unreviewed
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+--------------------------------------
Changes (by felixxm):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Thanks for this report, however this is a documented and expected behavior
 (see [https://docs.djangoproject.com/en/2.2/topics/forms/modelforms
 /#field-types "Field types"] and
 [https://docs.djangoproject.com/en/2.2/topics/forms/modelforms
 /#overriding-the-default-fields "Overriding the default fields"]):

 > ... Similarly, fields defined declaratively do not draw their attributes
 like max_length or required from the corresponding model. If you want to
 maintain the behavior specified in the model, you must set the relevant
 arguments explicitly when declaring the form field.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30831#comment:1>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.12ea50e2e456d300e5d174bbb81c8958%40djangoproject.com.

Reply via email to