def _ProjectionPartialEntityGenerator(cursor):
 for row in cursor:
  entity_original = entity_pb.EntityProto(row[1])
  entity = entity_pb.EntityProto()
  entity.mutable_key().MergeFrom(entity_original.key())
  entity.mutable_entity_group().MergeFrom(entity_original.entity_group())
  for (name, value_data) in zip(row[2::2], row[3::2]):
   prop_to_add = entity.add_property()
   prop_to_add.set_name(ToUtf8(name))
   value_decoder = sortable_pb_encoder.Decoder(array.array('B', str(value_data)))
   prop_to_add.mutable_value().Merge(value_decoder)
   prop_to_add.set_multiple(False)
  datastore_stub_util.PrepareSpecialPropertiesForLoad(entity)
  (yield entity)

def _ProjectionPartialEntityGenerator ( cursor ) : for row in cursor : entity_original = entity_pb . EntityProto ( row [ 1 ] ) entity = entity_pb . EntityProto ( ) entity . mutable_key ( ) . MergeFrom ( entity_original . key ( ) ) entity . mutable_entity_group ( ) . MergeFrom ( entity_original . entity_group ( ) ) for ( name , value_data ) in zip ( row [ 2 : : 2 ] , row [ 3 : : 2 ] ) : prop_to_add = entity . add_property ( ) prop_to_add . set_name ( ToUtf8 ( name ) ) value_decoder = sortable_pb_encoder . Decoder ( array . array ( 'B' , str ( value_data ) ) ) prop_to_add . mutable_value ( ) . Merge ( value_decoder ) prop_to_add . set_multiple ( False ) datastore_stub_util . PrepareSpecialPropertiesForLoad ( entity ) ( yield entity )
generator that creates partial entities for projection .