Django

Code

Changeset 7999

Show
Ignore:
Timestamp:
07/19/08 17:26:46 (4 months ago)
Author:
mtredinnick
Message:

Added a cavaet to the use of get_FOO_filename() and get_FOO_url(). This
constraint has always existed, but it's very hard to fix in the current code,
so better to work around it for now.

Refs #5619

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/db-api.txt

    r7884 r7999  
    22812281to the file, according to your ``MEDIA_ROOT`` setting. 
    22822282 
     2283.. note:: 
     2284    If you are using the ``upload_to`` parameter in your ``FileField``, it is 
     2285    only valid to call this method **after** saving the model when the field 
     2286    has been set. Prior to saving, the value returned will not contain the 
     2287    upload directory in the path. 
     2288 
    22832289Note that ``ImageField`` is technically a subclass of ``FileField``, so every 
    22842290model with an ``ImageField`` will also get this method. 
     
    22912297according to your ``MEDIA_URL`` setting. If the value is blank, this method 
    22922298returns an empty string. 
     2299 
     2300.. note:: 
     2301    As with ``get_FOO_filename()``, if you are using the ``upload_to`` 
     2302    parameter on your ``FileField``, it is only valid to call this method 
     2303    **after** saving the model, otherwise an incorrect result will be 
     2304    returned. 
    22932305 
    22942306get_FOO_size()