changeset 8d573f681193 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset&node=8d573f681193
description:
        Use simplified parser for get_eval_fields

        Instead of using the PYSONEncoder we can just iterate over the basic 
JSON types
        and use the pyson method to retrieve nested PYSON instances.

        issue11164
        review376551002
diffstat:

 tryton/pyson.py |  9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r 8f943feeb315 -r 8d573f681193 tryton/pyson.py
--- a/tryton/pyson.py   Sun Jan 30 01:42:23 2022 +0100
+++ b/tryton/pyson.py   Sun Jan 30 13:10:57 2022 +0100
@@ -162,6 +162,15 @@
                     }, context.get(base) or {})
         return context.get(dct['v'], dct['d'])
 
+    @property
+    def basename(self):
+        name = self._value
+        if name.startswith('_parent_'):
+            name = name[len('_parent_'):]
+        if '.' in name:
+            name = name.split('.', 1)[0]
+        return name
+
 
 class Not(PYSON):
 

Reply via email to