def convertGCIProfileDBEntityGroup(profile_key): """Converts DB based part of entity group associated with the specified profile. Args: profile_key: db.Key of the profile to process. """ to_delete = [] do_put = True org_scores = GCIOrgScore.all().ancestor(profile_key).fetch(1000) for org_score in org_scores: new_org_score = _convertParent(org_score) if do_put: new_org_score.put() to_delete.append(org_score) scores = GCIScore.all().ancestor(profile_key).fetch(1000) for score in scores: new_score = _convertParent(score) if do_put: new_score.put() to_delete.append(score) db.delete(to_delete)
def getListData(self): idx = lists.getListIndex(self.data.request) if idx == self.ORG_SCORE_LIST_IDX: q = GCIOrgScore.all() q.filter('org', self.data.organization) skipper = lambda entity, start: entity.numberOfTasks() <= 0 response_builder = lists.RawQueryContentResponseBuilder( self.data.request, self._list_config, q, lists.keyStarter, skipper=skipper) return response_builder.build() else: return None
def queryForAncestor(ancestor, keys_only=False): """Returns the query to fetch OrgScore entities for the specified ancestor. """ return GCIOrgScore.all(keys_only=keys_only).ancestor(ancestor)
def queryForAncestorAndOrg(ancestor, org, keys_only=False): """Returns the query to fetch OrgScore entities for the specified ancestor and organization. """ return GCIOrgScore.all(keys_only=keys_only).ancestor( ancestor).filter('org', org)
def queryForOrg(org, keys_only=False): """Return the query to fetch OrgScore entities for the specified organization. """ return GCIOrgScore.all(keys_only=keys_only).filter('org', org)
def queryForAncestorAndOrg(ancestor, org, keys_only=False): """Returns the query to fetch OrgScore entities for the specified ancestor and organization. """ return GCIOrgScore.all(keys_only=keys_only).ancestor(ancestor).filter( 'org', org)