* status: new => closed
* resolution: => fixed
Comment:
I think this was fixed as part of #10300. If that's not true, please
reopen.
--
Ticket URL: <https://code.djangoproject.com/ticket/9631#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: closed => new
* cc: Kevin Turner (added)
* version: 1.1-beta => 1.11
* resolution: fixed =>
Comment:
This is still present in Django 1.11.11; FieldFile.size usually delegates
to Storage instead of allowing its File to report (and, at its discretion,
cache) the size:
https://github.com/django/django/blob/1.11.11/django/db/models/fields/files.py#L73
I don't understand what the `if self._committed` is doing in there. Why
wouldn't it be appropriate to return `file.size` whether it's committed or
not? That's the implementation suggested by the initial patch here.
--
Ticket URL: <https://code.djangoproject.com/ticket/9631#comment:8>
* needs_better_patch: 0 => 1
Comment:
> Why wouldn't it be appropriate to return file.size whether it's
committed or not? That's the implementation suggested by the initial patch
here.
`self.file` could be `None` unless the file has been opened. But maybe
that check should instead be for `_file`, like the `open()` method. It
looks like the code path for using `file.size` was added for efficiency in
the first place in 68a890e79f6.
--
Ticket URL: <https://code.djangoproject.com/ticket/9631#comment:9>
* cc: Collin Anderson (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/9631#comment:10>