From 534c427b20237fb4224323c6f626fa68720545ee Mon Sep 17 00:00:00 2001 From: Chris Beaven Date: Fri, 22 Apr 2011 21:18:27 +0000 Subject: 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 --- docs/ref/forms/fields.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'docs/ref/forms') 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 `. -- cgit v1.3