I've been reading django/db/models/fields/files.py to figure out how
FileFields work under the hood, and I've noticed a bit I don't
understand. The __getstate__ method of FieldFile does:

return {'name': self.name, 'closed': False, '_committed': True,
'_file': None}

but the closed attribute of FieldFile is a property:

def _get_closed(self):
    file = getattr(self, '_file', None)
    return file is None or file.closed
closed = property(_get_closed)

so how does it make any sense to pickle a value for it? I looked in
the revision log on code.djangoproject.com, and I see that closed was
made a property in changeset 10737, but it looks like this changeset
forgot to remove this key/value pair from __getstate__?

Alexey

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to