Loading docs/ref/files/file.txt +3 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,9 @@ are the same as this one line:: >>> car.photo.save('myphoto.jpg', contents, save=True) Note that the ``content`` argument must be an instance of :class:`File` or of a subclass of :class:`File`. ``File.delete(save=True)`` ~~~~~~~~~~~~~~~~~~~~~~~~~~ Loading docs/ref/files/storage.txt +4 −0 Original line number Diff line number Diff line Loading @@ -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 :class:`~django.db.files.File`. ``Storage.delete(name)`` ~~~~~~~~~~~~~~~~~~~~~~~~ Loading docs/topics/files.txt +2 −1 Original line number Diff line number Diff line Loading @@ -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 django.core.files.storage import default_storage >>> from django.core.files.base import ContentFile >>> path = default_storage.save('/path/to/file', 'new content') >>> path = default_storage.save('/path/to/file', ContentFile('new content')) >>> path u'/path/to/file' Loading Loading
docs/ref/files/file.txt +3 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,9 @@ are the same as this one line:: >>> car.photo.save('myphoto.jpg', contents, save=True) Note that the ``content`` argument must be an instance of :class:`File` or of a subclass of :class:`File`. ``File.delete(save=True)`` ~~~~~~~~~~~~~~~~~~~~~~~~~~ Loading
docs/ref/files/storage.txt +4 −0 Original line number Diff line number Diff line Loading @@ -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 :class:`~django.db.files.File`. ``Storage.delete(name)`` ~~~~~~~~~~~~~~~~~~~~~~~~ Loading
docs/topics/files.txt +2 −1 Original line number Diff line number Diff line Loading @@ -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 django.core.files.storage import default_storage >>> from django.core.files.base import ContentFile >>> path = default_storage.save('/path/to/file', 'new content') >>> path = default_storage.save('/path/to/file', ContentFile('new content')) >>> path u'/path/to/file' Loading