Ticket #8641: r8729.diff
File r8729.diff, 856 bytes (added by , 16 years ago) |
---|
-
docs/ref/files/file.txt
100 100 101 101 Saves a new file with the file name and contents provided. This will not replace 102 102 the existing file, but will create a new file and update the object to point to 103 it. If ``save`` is ``True``, the model's ``save()`` method will be called once 103 it. The ``content`` parameter must be another :class:`File` object. A file on 104 the server can be saved by:: 105 106 >>> photo = open('/path/to/myphoto.jpg') 107 >>> car.photo.save('myphoto.jpg', File(photo), True) 108 109 If ``save`` is ``True``, the model's ``save()`` method will be called once 104 110 the file is saved. That is, these two lines:: 105 111 106 112 >>> car.photo.save('myphoto.jpg', contents, save=False)