mirror of
				https://github.com/django/django.git
				synced 2025-10-26 07:06:08 +00:00 
			
		
		
		
	Fixed deprecated UploadedFile.data attribute. Refs #7614.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7861 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		| @@ -96,9 +96,17 @@ class UploadedFile(object): | |||||||
|     filename = deprecated_property(old="filename", new="name") |     filename = deprecated_property(old="filename", new="name") | ||||||
|     file_name = deprecated_property(old="file_name", new="name") |     file_name = deprecated_property(old="file_name", new="name") | ||||||
|     file_size = deprecated_property(old="file_size", new="size") |     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) |     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): |     def multiple_chunks(self, chunk_size=None): | ||||||
|         """ |         """ | ||||||
|         Returns ``True`` if you can expect multiple chunks. |         Returns ``True`` if you can expect multiple chunks. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user