mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #13584 -- Optionally allow empty files with django.forms.FileField. Thanks for the patch erickr and closedbracket.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16090 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c77372cad0
commit
534c427b20
3 changed files with 13 additions and 2 deletions
|
@ -503,10 +503,15 @@ given length.
|
|||
* Empty value: ``None``
|
||||
* Normalizes to: An ``UploadedFile`` object that wraps the file content
|
||||
and file name into a single object.
|
||||
* Validates that non-empty file data has been bound to the form.
|
||||
* Can validate that non-empty file data has been bound to the form.
|
||||
* Error message keys: ``required``, ``invalid``, ``missing``, ``empty``,
|
||||
``max_length``
|
||||
|
||||
Has two optional arguments for validation, ''max_length'' and
|
||||
''allow_empty_file''. If provided, these ensure that the file name is at
|
||||
most the given length, and that validation will succeed even if the file
|
||||
content is empty.
|
||||
|
||||
To learn more about the ``UploadedFile`` object, see the :doc:`file uploads
|
||||
documentation </topics/http/file-uploads>`.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue