Ticket #8641: r8729.diff

File r8729.diff, 856 bytes (added by John Shimek, 16 years ago)

Added clarifiction on conent for the File.save method

  • docs/ref/files/file.txt

     
    100100
    101101Saves a new file with the file name and contents provided. This will not replace
    102102the 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
     103it. The ``content`` parameter must be another :class:`File` object.  A file on
     104the server can be saved by::
     105
     106    >>> photo = open('/path/to/myphoto.jpg')
     107    >>> car.photo.save('myphoto.jpg', File(photo), True)
     108
     109If ``save`` is ``True``, the model's ``save()`` method will be called once
    104110the file is saved. That is, these two lines::
    105111
    106112    >>> car.photo.save('myphoto.jpg', contents, save=False)
Back to Top