def ParsePropertyQuery(query, filters, orders):
 Check((not query.has_transaction()), 'transactional queries on __property__ not allowed')
 key_range = ParseKeyFilteredQuery(filters, orders)
 key_range.Remap((lambda x: _PropertyKeyToString(x, '')))
 if query.has_ancestor():
  ancestor = datastore_types.Key._FromPb(query.ancestor())
  (ancestor_kind, ancestor_property) = _PropertyKeyToString(ancestor, None)
  if (ancestor_property is not None):
   key_range.Update(datastore_pb.Query_Filter.EQUAL, (ancestor_kind, ancestor_property))
  else:
   key_range.Update(datastore_pb.Query_Filter.GREATER_THAN_OR_EQUAL, (ancestor_kind, ''))
   key_range.Update(datastore_pb.Query_Filter.LESS_THAN_OR_EQUAL, ((ancestor_kind + '\x00'), ''))
  query.clear_ancestor()
 return key_range

def ParsePropertyQuery ( query , filters , orders ) : Check ( ( not query . has_transaction ( ) ) , 'transactional queries on __property__ not allowed' ) key_range = ParseKeyFilteredQuery ( filters , orders ) key_range . Remap ( ( lambda x : _PropertyKeyToString ( x , '' ) ) ) if query . has_ancestor ( ) : ancestor = datastore_types . Key . _FromPb ( query . ancestor ( ) ) ( ancestor_kind , ancestor_property ) = _PropertyKeyToString ( ancestor , None ) if ( ancestor_property is not None ) : key_range . Update ( datastore_pb . Query_Filter . EQUAL , ( ancestor_kind , ancestor_property ) ) else : key_range . Update ( datastore_pb . Query_Filter . GREATER_THAN_OR_EQUAL , ( ancestor_kind , '' ) ) key_range . Update ( datastore_pb . Query_Filter . LESS_THAN_OR_EQUAL , ( ( ancestor_kind + '\x00' ) , '' ) ) query . clear_ancestor ( ) return key_range
parse __property__ queries .