From dbd99de6fa006798ca81ef43cbc83d88e5e6a377 Mon Sep 17 00:00:00 2001 From: Tobias McNulty Date: Wed, 27 Apr 2016 14:45:22 -0400 Subject: Fixed #26508 -- Clarified docs for various FieldFile methods. --- docs/ref/files/file.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'docs/ref/files') 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. -- cgit v1.3