Author: mtredinnick
Date: 2008-07-19 17:26:46 -0500 (Sat, 19 Jul 2008)
New Revision: 7999

Modified:
   django/trunk/docs/db-api.txt
Log:
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


Modified: django/trunk/docs/db-api.txt
===================================================================
--- django/trunk/docs/db-api.txt        2008-07-19 22:26:32 UTC (rev 7998)
+++ django/trunk/docs/db-api.txt        2008-07-19 22:26:46 UTC (rev 7999)
@@ -2280,6 +2280,12 @@
 where ``FOO`` is the name of the field. This returns the full filesystem path
 to the file, according to your ``MEDIA_ROOT`` setting.
 
+.. note::
+    If you are using the ``upload_to`` parameter in your ``FileField``, it is
+    only valid to call this method **after** saving the model when the field
+    has been set. Prior to saving, the value returned will not contain the
+    upload directory in the path.
+
 Note that ``ImageField`` is technically a subclass of ``FileField``, so every
 model with an ``ImageField`` will also get this method.
 
@@ -2291,6 +2297,12 @@
 according to your ``MEDIA_URL`` setting. If the value is blank, this method
 returns an empty string.
 
+.. note::
+    As with ``get_FOO_filename()``, if you are using the ``upload_to``
+    parameter on your ``FileField``, it is only valid to call this method
+    **after** saving the model, otherwise an incorrect result will be
+    returned.
+
 get_FOO_size()
 --------------
 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to