Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #8641: Documented the fact that file-saving methods must receiv…

…e a File instance

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent ce24a1f commit 84ef4a9b1decce8e319359a018eef46a9556b630 @ubernostrum ubernostrum committed
3  docs/ref/files/file.txt
@@ -110,6 +110,9 @@ are the same as this one line::
>>>'myphoto.jpg', contents, save=True)
+Note that the ``content`` argument must be an instance of
+:class:`File` or of a subclass of :class:`File`.
4 docs/ref/files/storage.txt
@@ -42,6 +42,10 @@ If there already exists a file with this name ``name``, the storage system may
modify the filename as necessary to get a unique name. The actual name of the
stored file will be returned.
+The ``content`` argument must be an instance of
+:class:`django.db.files.File` or of a subclass of
3  docs/topics/files.txt
@@ -96,8 +96,9 @@ You can create an instance of some custom file storage class, or -- often more
useful -- you can use the global default storage system::
>>> from import default_storage
+ >>> from django.core.files.base import ContentFile
- >>> path ='/path/to/file', 'new content')
+ >>> path ='/path/to/file', ContentFile('new content'))
>>> path

0 comments on commit 84ef4a9

Please sign in to comment.
Something went wrong with that request. Please try again.