Changes between Initial Version and Version 2 of Ticket #26367
- Timestamp:
- Mar 17, 2016, 9:42:26 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #26367
- Property Summary Minor FieldFile (proxy for FieldFile) improvement? → Assess if FieldFile can work with stdlib File instead of requiring Django's File
- Property Triage Stage Unreviewed → Accepted
-
Ticket #26367 – Description
initial v2 1 1 The FileField docs (https://docs.djangoproject.com/es/1.9/ref/models/fields/#django.db.models.FileField) state that in order to save a file into a FileField (through FieldFile proxy) you need a django File object and not a regular one. 2 2 3 Looking at the code (https://github.com/django/django/blob/ master/django/db/models/fields/files.py#L92 ) it seems like the only reason to have a File object is because it needs the 'size' property which isn't available on every file-like object.3 Looking at the code (https://github.com/django/django/blob/28bcff82c5ed4694f4761c303294ffafbd7096ce/django/db/models/fields/files.py#L92 ) it seems like the only reason to have a File object is because it needs the 'size' property which isn't available on every file-like object. 4 4 Looking into the same file, it doesn't seem anyone uses _size anymore, only its parent class, BUT, this class actually overrides the size property so it is not calling the parent class .size (and if it did, it would cache it). 5 5