def get_entity_group_version(entity_or_key):
"""Return the version of the entity group containing entity_or_key.
Args:
entity_or_key: a key or entity whose version you want.
Returns: The version of the entity group containing entity_or_key. This
version is guaranteed to increase on every change to the entity
group. The version may increase even in the absence of user-visible
changes to the entity group. May return None if the entity group was
never written to.
On non-HR datatores, this function returns None.
"""
eg = db.get(EntityGroup.key_for_entity(entity_or_key))
if eg:
return eg.version
else:
return None
评论列表
文章目录