#8484: Caching QuerySet with extra(select) causes AttributeError
-------------------------------------+--------------------------------------
Reporter: ckelly | Owner: nobody
Status: new | Milestone: 1.0
Component: Core framework | Version: SVN
Resolution: | Keywords:
Stage: Accepted | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-------------------------------------+--------------------------------------
Changes (by mtredinnick):
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* component: Uncategorized => Core framework
* needs_tests: => 0
* needs_docs: => 0
Comment:
This is one of those cool bugs that won't fail for everybody. This is
because the order in which attributes our restored during unpickling is
the order in which they were pickled, which is dependent upon the order
the keys from the class's attribute dictionary are returned. Since hashing
orders vary depending on platform/OS, Python type (e.g. jython, CPython),
and Python version, it only fails sometimes.
So the trick is to either force `keyOrder` to be pickled earlier than the
other data (by writing a custom `__getstate__` method) or by being able to
handle restores when `keyOrder` isn't already set. The former intuitively
feels a bit nicer (more robust) to me.
--
Ticket URL: <http://code.djangoproject.com/ticket/8484#comment:1>
Django Code <http://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 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---