#28744: enctype on <input> if FileField
------------------------------------------+------------------------
               Reporter:  Thomas Güttler  |          Owner:  nobody
                   Type:  Uncategorized   |         Status:  new
              Component:  Uncategorized   |        Version:  1.11
               Severity:  Normal          |       Keywords:
           Triage Stage:  Unreviewed      |      Has patch:  0
    Needs documentation:  0               |    Needs tests:  0
Patch needs improvement:  0               |  Easy pickings:  0
                  UI/UX:  0               |
------------------------------------------+------------------------
 I think it would be feasible to add the attribute `enctype` to html input
 elements for FileFields.

 Related docs: https://developer.mozilla.org/de/docs/Web/HTML/Element/Input
 #attr-formenctype

 My use case: to be able to stop this useless dancing in admin:


 {{{
 grep -rsi 'has_file_field' .

 ./contrib/admin/options.py:            'has_file_field': True,  # FIXME -
 this should check if form or formsets have a FileField,


 ./contrib/admin/templates/admin/change_form.html:<form {% if
 has_file_field %}enctype="multipart/form-data" {% endif %}action="{{
 form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>{%
 csrf_token %}{% block form_top %}{% endblock %}


 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28744>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.bd5400e3ad519aa3547b603515520401%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to