#9631: FieldFile assumes efficient Storage.size
-------------------------------------+-------------------------------------
     Reporter:  Peter Sagerson       |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  File                 |                  Version:  1.11
  uploads/storage                    |
     Severity:  Normal               |               Resolution:
     Keywords:  file upload          |             Triage Stage:  Design
  compression                        |  decision needed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Kevin Turner):

 * 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>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.ac541c557fd8735af1591c5b420d845c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to