#10865: Unable to pickle Queryset -----------------------------------------+---------------------------------- Reporter: wfa...@digipen.edu | Owner: nobody Status: new | Milestone: 1.1 Component: Uncategorized | Version: SVN Resolution: | Keywords: Stage: Unreviewed | Has_patch: 0 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | -----------------------------------------+---------------------------------- Comment (by wfa...@digipen.edu):
I have attached a test project that has the problem. Here is the code that causes the problem. {{{ from pickle_test.main.models import Place from django.contrib.auth.models import User from django.core.cache import cache import pickler user = User.objects.create(username="test_user") place = Place.objects.create(name="Test Place", address="Test Address", city="Wichita", state="KS", creator=user) places = Place.objects.all() cache.set("places", pickle.dumps(places)) c = cache.get("places") q = pickle.loads(c) Traceback (most recent call last): File "<console>", line 1, in <module> File "/usr/lib/python2.6/pickle.py", line 1374, in loads return Unpickler(file).load() File "/usr/lib/python2.6/pickle.py", line 858, in load dispatch[key](self) File "/usr/lib/python2.6/pickle.py", line 1090, in load_global klass = self.find_class(module, name) File "/usr/lib/python2.6/pickle.py", line 1124, in find_class __import__(module) TypeError: __import__() argument 1 must be string without null bytes, not str }}} -- Ticket URL: <http://code.djangoproject.com/ticket/10865#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-updates@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 -~----------~----~----~----~------~----~------~--~---