'Compare self to that w.r.t. values defined in the sort order.
Compare an entity with another, using sort-order first, then the key
order to break ties. This can be used in a heap to have faster min-value
lookup.
Args:
that: other entity to compare to
Returns:
negative: if self is less than that in sort order
zero: if self is equal to that in sort order
positive: if self is greater than that in sort order'

def __cmp__(self, that):

    property_compare = self.CmpProperties(that)
    if property_compare:
        return property_compare
    else:
        return cmp(self.__entity.key(), that.__entity.key())
