#36033: Getting TypeError: cannot pickle 'dict_values' object  Error with Django
4.2.16
-------------------------------------+-------------------------------------
     Reporter:  Bittu Ray            |                    Owner:  (none)
         Type:  Uncategorized        |                   Status:  closed
    Component:  Core (Cache system)  |                  Version:  4.2
     Severity:  Normal               |               Resolution:  invalid
     Keywords:  Django 4.2, Cache    |             Triage Stage:
  error, Redis Cache, Pickle         |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):

 Not sure what to say other than what the exception points at. If you plan
 on pickling an object then you must make sure it's pickleable so the
 obvious solution here to do

 {{{#!python
 queryset = Record.objects.filter(id__in=list(val.values()))
 }}}

 AFAIK Django doesn't provide any guarantees on how it stores lookup right-
 hand-sides internally so if it happened to work in 3.2 (I haven't verified
 it's the case) it was an implementation detail.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36033#comment:5>
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 visit 
https://groups.google.com/d/msgid/django-updates/01070193f45fc62d-e5e939af-f7c4-4f91-b410-67c8bfd92196-000000%40eu-central-1.amazonses.com.

Reply via email to