I have a list of entities which I want to store in the memcache. The problem is that I have large Models referenced by their ReferenceProperty which are automatically also stored in the memcache. As a result I'm exceeding the size limit for objects stored in memcache.
Is there any possibility to prevent the ReferenceProperties from loading the referenced Models while putting them in memcache?
I tried something like
def __getstate__(self):
odict = self.__dict__.copy()
odict['model'] = None
return odict
in the class I want to store in memcache, but that doesn't seem to do the trick.
Any suggestions would be highly appreciated.
Edit: I verified by adding a logging-statement that the __getstate__
-Method is executed.