diff options
| author | Karen Tracey <kmtracey@gmail.com> | 2011-11-19 15:08:07 +0000 |
|---|---|---|
| committer | Karen Tracey <kmtracey@gmail.com> | 2011-11-19 15:08:07 +0000 |
| commit | c8c71057aad21d71b512a87cc4a7020e8abfb12f (patch) | |
| tree | 9766597975ba0e3686b2b92ea50611f0d1e83288 /docs/ref | |
| parent | 549c495875d279c17fbd418238a305bcc51cdad6 (diff) | |
Fix #15646: Document that a FileField's full path can't be relied upon 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
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/models/fields.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index e0cf92f9c3..c94309257c 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -572,6 +572,11 @@ information on the available attributes and methods, see the :class:`~django.core.files.File` class reference and the :doc:`/topics/files` topic guide. +.. note:: + The file is saved as part of saving the model in the database, so the actual + file name used on disk cannot be relied on until after the model has been + saved. + The uploaded file's relative URL can be obtained using the :attr:`~django.db.models.fields.FileField.url` attribute. Internally, this calls the :meth:`~django.core.files.storage.Storage.url` method of the |
