Support dot notation on PYSON Eval
issue8528 review287841003
This commit is contained in:
1 parent
4fcf8c5c8f
commit
57e0526c00
2 files changed
+7
No files matched your search
@@ -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
|
||||
|
||||
@@ -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'])
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user