def _get_user_profile_dict(request, usernames):
 request.GET = request.GET.copy()
 request.GET['username'] = usernames
 user_profile_details = AccountViewSet.as_view({'get': 'list'})(request).data
 return {user['username']: user for user in user_profile_details}

def _get_user_profile_dict ( request , usernames ) : request . GET = request . GET . copy ( ) request . GET [ 'username' ] = usernames user_profile_details = AccountViewSet . as_view ( { 'get' : 'list' } ) ( request ) . data return { user [ 'username' ] : user for user in user_profile_details }
gets user profile details for a list of usernames and creates a dictionary with profile details against username .