[Django] #27246: Factor out input template in ClearableFileInput and document template class attributes

1 view
Skip to first unread message

Django

unread,
Sep 19, 2016, 12:15:44 PM9/19/16
to django-...@googlegroups.com
#27246: Factor out input template in ClearableFileInput and document template class
attributes
-----------------------------+--------------------
Reporter: mpauly | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------
`ClearableFileInput` uses a template variable in its `render()`
implementation (see
https://github.com/django/django/blob/master/django/forms/widgets.py#L405)
that I would like to factor out as a class attribute.

This would allow to change the appearance of the 'Select file' button for
`ClearableFileInput`, by e.g. wrapping it in a div and adding a span. For
normal `FileInput` that is already possible by overwriting the render
method, however for `ClearableFileInput` this gets comparably ugly.
This would be in line with having the other template strings as class
attributes.

Also I believe it would be good to document the multiple `template_*`
class attributes.

--
Ticket URL: <https://code.djangoproject.com/ticket/27246>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 19, 2016, 12:22:14 PM9/19/16
to django-...@googlegroups.com
#27246: Factor out input template in ClearableFileInput and document template class
attributes
-----------------------------+--------------------------------------
Reporter: mpauly | Owner: mpauly
Type: New feature | Status: assigned
Component: Forms | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------------------------
Changes (by mpauly):

* status: new => assigned
* needs_better_patch: => 0
* owner: nobody => mpauly
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/27246#comment:1>

Django

unread,
Sep 19, 2016, 12:46:30 PM9/19/16
to django-...@googlegroups.com
#27246: Factor out input template in ClearableFileInput and document template class
attributes
-----------------------------+--------------------------------------
Reporter: mpauly | Owner: mpauly
Type: New feature | Status: closed
Component: Forms | Version: 1.10
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------------------------
Changes (by timgraham):

* status: assigned => closed
* resolution: => wontfix


Comment:

We're targeting template-based widget rendering (#15667) for Django 1.11
which I believe obsoletes this. Feel free to take at the latest pull
request there and offer feedback.

--
Ticket URL: <https://code.djangoproject.com/ticket/27246#comment:2>

Reply all
Reply to author
Forward
0 new messages