summaryrefslogtreecommitdiff
path: root/docs/ref/files
diff options
context:
space:
mode:
authorTobias McNulty <tobias@caktusgroup.com>2016-04-27 14:45:22 -0400
committerTim Graham <timograham@gmail.com>2016-05-07 12:16:42 -0400
commitdbd99de6fa006798ca81ef43cbc83d88e5e6a377 (patch)
treed09f2e06e02d5f477350b21c5b7ece648b0ad3f2 /docs/ref/files
parent101dd787eca588f32c4647fe45fc533072f0eb0b (diff)
Fixed #26508 -- Clarified docs for various FieldFile methods.
Diffstat (limited to 'docs/ref/files')
-rw-r--r--docs/ref/files/file.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/ref/files/file.txt b/docs/ref/files/file.txt
index b89b31e9f7..a669e7c1a9 100644
--- a/docs/ref/files/file.txt
+++ b/docs/ref/files/file.txt
@@ -31,6 +31,17 @@ The ``File`` class
The underlying :py:term:`file object` that this class wraps.
+ .. admonition:: Be careful with this attribute in subclasses.
+
+ Some subclasses of :class:`File`, including
+ :class:`~django.core.files.base.ContentFile` and
+ :class:`~django.db.models.fields.files.FieldFile`, may replace this
+ attribute with an object other than a Python :py:term:`file object`.
+ In these cases, this attribute may itself be a :class:`File`
+ subclass (and not necessarily the same subclass). Whenever
+ possible, use the attributes and methods of the subclass itself
+ rather than the those of the subclass's ``file`` attribute.
+
.. attribute:: mode
The read/write mode for the file.