Support dot notation on PYSON Eval

issue8528
review287841003
This commit is contained in:
Sergi Almacellas Abellana committed 2019-09-19 14:11:23 +02:00
1 parent 4fcf8c5c8f
commit 57e0526c00
2 files changed
+7

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Support dot notation on PYSON Eval
* Order Dict keys by sequence
* Support relation fields in domain parser
* Add Dict widget for tree view
+6
View File
@@ -153,6 +153,12 @@ class Eval(PYSON):
@staticmethod
def eval(dct, context):
if '.' in dct['v']:
base, name = dct['v'].split('.', 1)
return Eval.eval({
'v': name,
'd': dct['d'],
}, context.get(base) or {})
return context.get(dct['v'], dct['d'])