Opened 11 years ago

Last modified 9 years ago

#13328 closed

Pickling a queryset with a datetime__lte filter causes a TypeError — at Version 1

Reported by: Brandon Konkle Owned by: nobody
Component: Database layer (models, ORM) Version: 1.2-beta
Severity: Keywords: pickle, queryset, datetime__lte
Cc: brandonkonkle@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Karen Tracey)

We're caching with memcached, and using django.core.cache to directly set cache values. When we try to cache a queryset of blog entries with a datetime__lte filter, we get a TypeError telling us that a string or Unicode object was expected, but a NoneType was received instead. I'm attaching an abbreviated example of the model and manager we're using, and the shell steps taken to reproduce the error along with the traceback it provides.

The error is related to line 6 of the attached file - if I remove the filter, the cache.set works without an issue.

Change History (3)

Changed 11 years ago by Brandon Konkle

Attachment: interacitve_output.txt added

iPython interactive interpreter output, including traceback

Changed 11 years ago by Brandon Konkle

Attachment: added

An abbreviated which, when used, reproduces the error.

comment:1 Changed 11 years ago by Karen Tracey

Description: modified (diff)

Fixed formatting. Please use preview.

Note: See TracTickets for help on using tickets.
Back to Top