On Fri, Jan 21, 2011 at 5:50 AM, Alexey Toptygin
<[email protected]> wrote:
> 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__?

Seems likely that this was just oversight. If you can open a ticket,
we can make sure that this isn't forgotten.

Yours,
Russ Magee %-)

-- 
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