Opened 15 years ago

Last modified 13 years ago

#13328 closed

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

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

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 datetimelte 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 manage.py shell steps taken to reproduce the error along with the traceback it provides.

The error is related to line 6 of the attached models.py file - if I remove the release_datelte=datetime.datetime.now() filter, the cache.set works without an issue.

Change History (2)

by Brandon Konkle, 15 years ago

Attachment: interacitve_output.txt added

iPython interactive interpreter output, including traceback

by Brandon Konkle, 15 years ago

Attachment: models.py added

An abbreviated models.py which, when used, reproduces the error.

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