diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-07-07 23:36:45 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-07-07 23:36:45 +0000 |
| commit | f804e7f03810f5495445a2960d1ea7c6d0635328 (patch) | |
| tree | f51c5930dfddaf6db2fdc020c50b7cc9733dea44 | |
| parent | c83e9abb34bca78e9d6d451614d00f816674e5a8 (diff) | |
Fixed deprecated UploadedFile.data attribute. Refs #7614.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7861 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/core/files/uploadedfile.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/django/core/files/uploadedfile.py b/django/core/files/uploadedfile.py index bf5848421d..9287a1bec8 100644 --- a/django/core/files/uploadedfile.py +++ b/django/core/files/uploadedfile.py @@ -96,9 +96,17 @@ class UploadedFile(object): filename = deprecated_property(old="filename", new="name") file_name = deprecated_property(old="file_name", new="name") file_size = deprecated_property(old="file_size", new="size") - data = deprecated_property(old="data", new="read", readonly=True) chunk = deprecated_property(old="chunk", new="chunks", readonly=True) + def _get_data(self): + warnings.warn( + message = "UploadedFile.data is deprecated; use UploadedFile.read() instead.", + category = DeprecationWarning, + stacklevel = 2 + ) + return self.read() + data = property(_get_data) + def multiple_chunks(self, chunk_size=None): """ Returns ``True`` if you can expect multiple chunks. |
