def _build_query(self):
        for query in self.gae_query:
            query.Order(*self.ordering)

            #This is an ancestor query
            if self.ancestor_key:
                query.Ancestor(self.ancestor_key)

        if len(self.gae_query) > 1:
            return MultiQuery(self.gae_query, self.ordering)
        return self.gae_query[0]