@@ -0,0 +1,1437 @@
+#!/usr/bin/env python2.5%0A#%0A# Copyright 2011 the Melange authors.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A#   http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A%0A%22%22%22GCI logic for profiles.%0A%22%22%22%0A%0A__authors__ = %5B%0A    '%22Madhusudan.C.S%22 %3Cmadhusudancs@gmail.com%3E',%0A    %5D%0A%0A%0Afrom soc.modules.gci.models.profile import GCIProfile%0A%0A%0Adef queryAllMentorsKeysForOrg(org, limit=1000):%0A  %22%22%22Returns a list of keys of all the mentors for the organization%0A%0A  Args:%0A    org: the organization entity for which we need to get all the mentors%0A    limit: the maximum number of entities that must be fetched%0A%0A  returns:%0A    List of all the mentors for the organization%0A  %22%22%22%0A%0A  # get all mentors keys first%0A  query = GCIProfile.all(keys_only=True)%0A  query.filter('mentor_for', org)%0A  mentors_keys = query.fetch(limit=limit)%0A%0A  # get all org admins keys first%0A  query = GCIProfile.all(keys_only=True)%0A  query.filter('org_admin_for', org)%0A  oa_keys = query.fetch(limit=limit)%0A%0A  return set(mentors_keys + oa_keys)%0A

Implement a method that fetches all the mentors for a given organization.