mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #7048 -- Added ClearableFileInput widget to clear file fields. Thanks for report and patch, jarrow and Carl Meyer.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13968 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -116,7 +116,7 @@ HTML escaped.
|
||||
|
||||
>>> w = AdminFileWidget()
|
||||
>>> print conditional_escape(w.render('test', album.cover_art))
|
||||
Currently: <a target="_blank" href="%(STORAGE_URL)salbums/hybrid_theory.jpg">albums\hybrid_theory.jpg</a> <br />Change: <input type="file" name="test" />
|
||||
<p class="file-upload">Currently: <a target="_blank" href="%(STORAGE_URL)salbums/hybrid_theory.jpg">albums\hybrid_theory.jpg</a> <span class="clearable-file-input"><input type="checkbox" name="test-clear" id="test-clear_id" /> <label for="test-clear_id">Clear</label></span><br />Change: <input type="file" name="test" /></p>
|
||||
>>> print conditional_escape(w.render('test', SimpleUploadedFile('test', 'content')))
|
||||
<input type="file" name="test" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user