Ticket #1994: db-api.diff
File db-api.diff, 1.2 KB (added by , 18 years ago) |
---|
-
db-api.txt
1563 1563 where ``FOO`` is the name of the field. This returns the size of the file, in 1564 1564 bytes. (Behind the scenes, it uses ``os.path.getsize``.) 1565 1565 1566 save_FOO_file(filename, raw_contents )1566 save_FOO_file(filename, raw_contents, upload_to="") 1567 1567 ------------------------------------- 1568 1568 1569 1569 For every ``FileField``, the object will have a ``save_FOO_file()`` method, 1570 1570 where ``FOO`` is the name of the field. This saves the given file to the 1571 1571 filesystem, using the given filename. If a file with the given filename already 1572 1572 exists, Django adds an underscore to the end of the filename (but before the 1573 extension) until the filename is available. 1573 extension) until the filename is available. 1574 1574 1575 The 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. 1576 1575 1577 get_FOO_height() and get_FOO_width() 1576 1578 ------------------------------------ 1577 1579