From f7133b8670e02041aefbd55338ce75460c458aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Fri, 6 Jun 2014 13:26:44 +0200 Subject: [PATCH] Use total_ordering issue3884 review8291003 --- trytond/model/model.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/trytond/model/model.py b/trytond/model/model.py index a09ef0385d..686ae986c6 100644 --- a/trytond/model/model.py +++ b/trytond/model/model.py @@ -4,6 +4,7 @@ import copy import collections import warnings +from functools import total_ordering from trytond.model import fields from trytond.error import WarningErrorMixin @@ -16,6 +17,7 @@ from trytond.rpc import RPC __all__ = ['Model'] +@total_ordering class Model(WarningErrorMixin, URLMixin, PoolBase): """ Define a model in Tryton. @@ -490,11 +492,6 @@ class Model(WarningErrorMixin, URLMixin, PoolBase): return NotImplemented return self.id < other.id - # TODO: replace by total_ordering when 2.6 will be dropped - __gt__ = lambda self, other: not (self < other or self == other) - __le__ = lambda self, other: self < other or self == other - __ge__ = lambda self, other: not self < other - def __ne__(self, other): if not isinstance(other, Model): return NotImplemented