Ticket #7812: inmemoryupload_fileseek-r7977.patch
File inmemoryupload_fileseek-r7977.patch, 1.0 KB (added by , 16 years ago) |
---|
-
django/core/files/uploadedfile.py
194 194 Returns the full path of this file. 195 195 """ 196 196 return self._file.name 197 197 198 198 # Most methods on this object get proxied to NamedTemporaryFile. 199 199 # We can't directly subclass because NamedTemporaryFile is actually a 200 200 # factory function 201 def read(self, *args): return self._file.read(*args) 201 def read(self, *args): 202 self._file.seek(0) 203 return self._file.read(*args) 204 202 205 def seek(self, offset): return self._file.seek(offset) 203 206 def write(self, s): return self._file.write(s) 204 207 def close(self): return self._file.close() … … 223 226 self.seek(0) 224 227 225 228 def read(self, *args, **kwargs): 229 self.file.seek(0) 226 230 return self.file.read(*args, **kwargs) 227 231 228 232 def chunks(self, chunk_size=None):