#14515: Can't pickle ValueQuerySet if query references fields, which aren't on 
the
same model.
---------------------------------------------------+------------------------
          Reporter:  apollo13                      |         Owner:  nobody
            Status:  new                           |     Milestone:  1.3   
         Component:  Database layer (models, ORM)  |       Version:  1.2   
        Resolution:                                |      Keywords:        
             Stage:  Unreviewed                    |     Has_patch:  0     
        Needs_docs:  0                             |   Needs_tests:  0     
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Old description:

> This will work during pickle.dumps: http://paste.pocoo.org/show/278047/
> but will fail when I run loads.
>
>  The reason is that __getstate__ of ValueQueryset puts (in this case)
> ['name', 'deleted', 'id', 'id'] into obj_dict['search_fields']
> (http://code.djangoproject.com/browser/django/trunk/django/db/models/sql/query.py#L176);
> during loads it won't find Page.deleted etc… (full traceback:
> http://paste.pocoo.org/show/278050/)

New description:

 This will work during pickle.dumps: http://paste.pocoo.org/show/278047/
 but will fail when I run loads.

  The reason is that {{{ __getstate__ }}} of {{{ ValueQueryset }}} puts (in
 this case) {{{ ['name', 'deleted', 'id', 'id'] }}} into {{{
 obj_dict['search_fields'] }}}
 
(http://code.djangoproject.com/browser/django/trunk/django/db/models/sql/query.py#L176);
 during loads it won't find Page.deleted etc… (full traceback:
 http://paste.pocoo.org/show/278050/)

Comment (by Alex):

 Cleaned up the formatting.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14515#comment:3>
Django <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 django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to