Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) Type "copyright", "credits" or "license" for more information. IPython 0.9.1 -- An enhanced Interactive Python. In [1]: from myapp.blogs.models import Entry In [2]: from django.core.cache import cache In [3]: e = Entry.live.order_by('-release_date')[:10] In [4]: cache.set('temp', e, 10) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /path/to/myapp/ in () /path/to/django/core/cache/backends/memcached.pyc in set(self, key, value, timeout) 52 53 def set(self, key, value, timeout=0): ---> 54 self._cache.set(smart_str(key), value, self._get_memcache_timeout(timeout)) 55 56 def delete(self, key): /path/to/myvirtualenv/lib/python2.6/site-packages/memcache.pyc in set(self, key, val, time, min_compress_len) 513 indicating don't ever try to compress. 514 ''' --> 515 return self._set("set", key, val, time, min_compress_len) 516 517 /path/to/myvirtualenv/lib/python2.6/site-packages/memcache.pyc in _set(self, cmd, key, val, time, min_compress_len) 723 self._statlog(cmd) 724 --> 725 store_info = self._val_to_store_info(val, min_compress_len) 726 if not store_info: return(0) 727 /path/to/myvirtualenv/lib/python2.6/site-packages/memcache.pyc in _val_to_store_info(self, val, min_compress_len) 695 if self.persistent_id: 696 pickler.persistent_id = self.persistent_id --> 697 pickler.dump(val) 698 val = file.getvalue() 699 TypeError: expected string or Unicode object, NoneType found