Opened 11 years ago
Closed 10 years ago
#21201 closed New feature (fixed)
Let ClearableFileInput work with other fields
Reported by: | Vlastimil Zíma | Owned by: | Vlastimil Zíma |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Daniele Procida | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
ClearableFileInput
is very useful widget, problem is that it can only be used with FileField
as it only expects FieldFile
as an initial value.
I propose a decomposition (see patch) which allows easy modification to use this widget with other fields.
Example: File input is used over data which are stored in database.
This problem is remotely connected with #15667 which may (or may not) solve this issue.
Attachments (1)
Change History (10)
by , 11 years ago
Attachment: | clearable-file-input.patch added |
---|
comment:1 by , 11 years ago
Cc: | added |
---|---|
Needs tests: | set |
Triage Stage: | Unreviewed → Accepted |
follow-up: 3 comment:2 by , 11 years ago
Needs documentation: | set |
---|
comment:3 by , 11 years ago
comment:4 by , 11 years ago
docs/forms/ref/widgets.txt documents ClearableFileInput, but not the internals; I don't see any particular need to document internals of widgets. Perhaps an example of usage would be helpful.
comment:5 by , 11 years ago
This patch does change the behaviour of the widget, so we will need to understand any backwards-compatibility implications of it.
comment:6 by , 11 years ago
Needs documentation: | unset |
---|---|
Needs tests: | unset |
Owner: | changed from | to
Status: | new → assigned |
I have updated a patch and created pull request https://github.com/django/django/pull/1807
comment:7 by , 10 years ago
Patch needs improvement: | set |
---|
I left comments for improvement on the PR. Please uncheck "Patch needs improvement" when you update it, thanks.
comment:9 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Replying to EvilDMP:
Do you have in mind any particular changes in documentation beside note in changelog? Current documentation does not describe these internals of the widget.