'Returns a tuple of (original projection, projeciton override).
If projection is None, there is no projection. If override is None,
projection is sufficent for this query.'

def __GetProjectionOverride(self, config):

    projection = datastore_query.QueryOptions.projection(config)
    if (projection is None):
        projection = self.__projection
    else:
        projection = projection
    if (not projection):
        return (None, None)
    override = set()
    for (prop, _) in self.__orderings:
        if (prop not in projection):
            override.add(prop)
    if (not override):
        return (projection, None)
    return (projection, (projection + tuple(override)))
