Ticket #1994: db-api.diff

File db-api.diff, 1.2 KB (added by parlar@…, 12 years ago)

Documentation patch for the new keyword

  • db-api.txt

    15631563where ``FOO`` is the name of the field. This returns the size of the file, in
    15641564bytes. (Behind the scenes, it uses ``os.path.getsize``.)
    1566 save_FOO_file(filename, raw_contents)
     1566save_FOO_file(filename, raw_contents, upload_to="")
    15691569For every ``FileField``, the object will have a ``save_FOO_file()`` method,
    15701570where ``FOO`` is the name of the field. This saves the given file to the
    15711571filesystem, using the given filename. If a file with the given filename already
    15721572exists, Django adds an underscore to the end of the filename (but before the
    1573 extension) until the filename is available.
     1573extension) until the filename is available. 
     1575The optional ``upload_to`` keyword allows you to override the ``upload_to`` that is specified in the model. Note that this override is per-save, so if you don't specify it the next time you call this method, the ``upload_to`` in the model will be used.
    15751577get_FOO_height() and get_FOO_width()
Back to Top