summaryrefslogtreecommitdiff
path: root/docs/newforms.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/newforms.txt')
-rw-r--r--docs/newforms.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/newforms.txt b/docs/newforms.txt
index 8386c0507c..be3a0b6a2a 100644
--- a/docs/newforms.txt
+++ b/docs/newforms.txt
@@ -808,12 +808,12 @@ ContactForm to include an ``ImageField`` called ``mugshot``, we
need to bind the file data containing the mugshot image::
# Bound form with an image field
+ >>> from django.core.files.uploadedfile import SimpleUploadedFile
>>> data = {'subject': 'hello',
... 'message': 'Hi there',
... 'sender': 'foo@example.com',
... 'cc_myself': True}
- >>> file_data = {'mugshot': {'filename':'face.jpg'
- ... 'content': <file data>}}
+ >>> file_data = {'mugshot': SimpleUploadedFile('face.jpg', <file data>)}
>>> f = ContactFormWithMugshot(data, file_data)
In practice, you will usually specify ``request.FILES`` as the source