﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26900	Defer FileFields causes errors when accessing them	Samuel Maudo	nobody	"The problem is in `FileDescriptor.__get__()`. That method obtains the file directly from `instance.__dict__` but, from Django 1.10, deferred fields don't create any item in `instance.__dict__`, so a KeyError is raised.

Moreover, ImageFields access the file each time a model is instantiated to update dimension fields, so a KeyError is raised whenever an instance with a deferred ImageField is created.

The obvious solution is change `file = instance.__dict__[self.field.name]` for `file = instance.__dict__.get(self.field.name)` inside of `FileDescriptor.__get__()` but I am not sure about the consequences."	Bug	closed	Database layer (models, ORM)	1.10	Release blocker	fixed			Accepted	1	0	0	0	0	0
