@gen.coroutine
def _QueryFollowedForArchive(client, user_id):
 followed = (yield gen.Task(Followed.RangeQuery, client, hash_key=user_id, range_desc=None, limit=None, col_names=['viewpoint_id'], excl_start_key=None))
 viewpoint_keys = [db_client.DBKey(f.viewpoint_id, None) for f in followed]
 follower_keys = [db_client.DBKey(user_id, f.viewpoint_id) for f in followed]
 (viewpoints, followers) = (yield [gen.Task(Viewpoint.BatchQuery, client, viewpoint_keys, None, must_exist=False), gen.Task(Follower.BatchQuery, client, follower_keys, None, must_exist=False)])
 response = {'viewpoints': [_MakeViewpointMetadataDict(v, f) for (v, f) in zip(viewpoints, followers) if ((v is not None) and (not v.IsDefault()))]}
 raise gen.Return(response)

@ gen . coroutine def _QueryFollowedForArchive ( client , user_id ) : followed = ( yield gen . Task ( Followed . RangeQuery , client , hash_key = user_id , range_desc = None , limit = None , col_names = [ 'viewpoint_id' ] , excl_start_key = None ) ) viewpoint_keys = [ db_client . DBKey ( f . viewpoint_id , None ) for f in followed ] follower_keys = [ db_client . DBKey ( user_id , f . viewpoint_id ) for f in followed ] ( viewpoints , followers ) = ( yield [ gen . Task ( Viewpoint . BatchQuery , client , viewpoint_keys , None , must_exist = False ) , gen . Task ( Follower . BatchQuery , client , follower_keys , None , must_exist = False ) ] ) response = { 'viewpoints' : [ _MakeViewpointMetadataDict ( v , f ) for ( v , f ) in zip ( viewpoints , followers ) if ( ( v is not None ) and ( not v . IsDefault ( ) ) ) ] } raise gen . Return ( response )
queries all viewpoints followed by the requested user .