'Gets a datastore_query.Order for the current instance.
Returns:
datastore_query.Order or None if there are no sort orders set on the
current Query.'

def GetOrder(self):

    orders = [datastore_query.PropertyOrder(property, direction) for (property, direction) in self.__orderings]
    if orders:
        return datastore_query.CompositeOrder(orders)
    return None
