More helpful error messasge on Range order attempts

This commit is contained in:
Daniele Varrazzo 2012-09-25 00:02:24 +01:00
parent f70e6a1519
commit b8b669611e

View File

@ -132,7 +132,9 @@ class Range(object):
return hash((self._lower, self._upper, self._bounds)) return hash((self._lower, self._upper, self._bounds))
def __lt__(self, other): def __lt__(self, other):
raise TypeError('Range objects are not ordered') raise TypeError(
'Range objects cannot be ordered; please refer to the PostgreSQL'
' documentation to perform this operation in the database')
__le__ = __gt__ = __ge__ = __lt__ __le__ = __gt__ = __ge__ = __lt__