Use same __str__ as trytond instances

issue9053
review291081002
This commit is contained in:
Cédric Krier
2020-03-06 23:55:34 +01:00
parent 9cdcfdb2d6
commit 5a5b61ba3a
2 changed files with 5 additions and 4 deletions
+2
View File
@@ -1,3 +1,5 @@
* Use same __str__ as trytond instances
Version 5.4.0 - 2019-11-04
* Bug fixes (see mercurial logs for details)
* Support dot notation on PYSON Eval
+3 -4
View File
@@ -57,7 +57,8 @@ class _EvalEnvironment(dict):
def __str__(self):
return str(self.parent)
__repr__ = __str__
def __repr__(self):
return repr(self.parent)
def __contains__(self, item):
if item == 'id':
@@ -772,8 +773,7 @@ class Model(object):
del models[name]
def __str__(self):
return '<%s(%d)>' % (self.__class__.__name__, self.id)
__str__.__doc__ = object.__str__.__doc__
return '%s,%d' % (self.__class__.__name__, self.id)
def __repr__(self):
if self._config == proteus.config.get_config():
@@ -781,7 +781,6 @@ class Model(object):
self.id)
return "proteus.Model.get('%s', %s)(%d)" % (self.__class__.__name__,
repr(self._config), self.id)
__repr__.__doc__ = object.__repr__.__doc__
def __eq__(self, other):
if isinstance(other, Model):