diff options
| author | Chris Beaven <smileychris@gmail.com> | 2011-04-22 21:18:27 +0000 |
|---|---|---|
| committer | Chris Beaven <smileychris@gmail.com> | 2011-04-22 21:18:27 +0000 |
| commit | 534c427b20237fb4224323c6f626fa68720545ee (patch) | |
| tree | 04f5fba897392d1af2aafc0acb45dee7bd991517 /docs/ref | |
| parent | c77372cad034b06c1b7239ff6e1284c832f4a541 (diff) | |
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
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/forms/fields.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index 338a80655e..3bc0659c3d 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -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>`. |
