Skip to content Skip to sidebar Skip to footer

How Can I Test The Validity Of A Referenceproperty In Appengine?

I am currently testing a small application I have written. I have not been sufficiently careful in ensuring the data in my datastore is consistent and now I have an issue that I ha

Solution 1:

This will test key existence without returning an entity:

db.Query(keys_only=True).filter('__key__ =', test_key).count(1) == 1

I'm not certain that it's computationally cheaper than fetching the entity.

Post a Comment for "How Can I Test The Validity Of A Referenceproperty In Appengine?"