#31943: Queryset with values()/values_list() crashes when recreated from a 
pickled
query.
-------------------------------------+-------------------------------------
     Reporter:  Beda Kosata          |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  2.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

 Is there any reason you can't pickle the queryset object itself instead of
 `queryset.query`?

 It feels like pickling of `QuerySet.query` and reassignment to an
 independently created `QuerySet` instance is asking for trouble. It's not
 a tested or documented pattern AFAIK.

 The `QuerySet` abstraction manages resultset caching, prefetching and
 iteration while `Query` abstraction deals with SQL compilation and
 execution. If you want to ''pickle'' an object that can be used for later
 iteration I'd say you should pickle `QuerySet` instead or `Query`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31943#comment:3>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.9bf8ab9876933b137bee991bb30fb41e%40djangoproject.com.

Reply via email to