I’d like to bypass some frequent queries by storing str(key) in memcache. When I get the encoded_key back from memcached, I can reconstruct the key with Key(encoded=encoded_key).
But how can I query the actual object from the key? A possibility would be to use
GqlQuery('SELECT * FROM ' + Key(encoded_key).kind() + \
' WHERE __key__ = ' + encoded_key)
but I’d rather not use GQL if possible. Is there a way of getting the object without using GQL?
Are you just storing the result of
str(key)in memcached? If so, when you get it back, you should be able to just dodb.get(key)to get the entity to which it points.db.get()will take either adb.Keyobject or the string representation of adb.Keyobject (or a list of keys or key strings).