Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix #15646: Document that a FileField's full path can't be relied upo…

…n until its model has been saved to the database. Thanks poirier.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c8c71057aad21d71b512a87cc4a7020e8abfb12f 1 parent 549c495
Karen Tracey authored November 19, 2011
5  docs/ref/models/fields.txt
@@ -572,6 +572,11 @@ information on the available attributes and methods, see the
572 572
 :class:`~django.core.files.File` class reference and the :doc:`/topics/files`
573 573
 topic guide.
574 574
 
  575
+.. note::
  576
+    The file is saved as part of saving the model in the database, so the actual
  577
+    file name used on disk cannot be relied on until after the model has been
  578
+    saved.
  579
+
575 580
 The uploaded file's relative URL can be obtained using the
576 581
 :attr:`~django.db.models.fields.FileField.url` attribute. Internally,
577 582
 this calls the :meth:`~django.core.files.storage.Storage.url` method of the
6  docs/topics/files.txt
@@ -45,6 +45,12 @@ the details of the attached photo::
45 45
 This object -- ``car.photo`` in the example -- is a ``File`` object, which means
46 46
 it has all the methods and attributes described below.
47 47
 
  48
+.. note::
  49
+    The file is saved as part of saving the model in the database, so the actual
  50
+    file name used on disk cannot be relied on until after the model has been
  51
+    saved.
  52
+
  53
+
48 54
 The ``File`` object
49 55
 ===================
50 56
 

0 notes on commit c8c7105

Please sign in to comment.
Something went wrong with that request. Please try again.