Ticket #12955: django-12955.diff
File django-12955.diff, 758 bytes (added by , 15 years ago) |
---|
-
django/db/models/fields/files.py
old new class FieldFile(File): 73 73 def _get_size(self): 74 74 self._require_file() 75 75 if not self._committed: 76 return len(self.file)76 return self.file.size 77 77 return self.storage.size(self.name) 78 78 size = property(_get_size) 79 79 … … class FieldFile(File): 93 93 setattr(self.instance, self.field.name, self.name) 94 94 95 95 # Update the filesize cache 96 self._size = len(content)96 self._size = content.size 97 97 self._committed = True 98 98 99 99 # Save the object because it has changed, unless save is False