Get function added

Refgistered a YAQL function to retrieve dictionary values by dynamically-computed keys

Change-Id: I92b85cfa0d7bd70d0b698184071ee00cca44989b
This commit is contained in:
Alexander Tivelkov 2014-04-23 16:08:20 +04:00
parent ab1c1b0ccc
commit 827f8ce4c9
1 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import types
import jsonpatch
import jsonpointer
import yaql.context
import yaql.functions.builtin as yaql_builtin
import muranoapi.common.config as cfg
import muranoapi.dsl.helpers as helpers
@ -228,3 +229,6 @@ def register(context):
context.register_function(_str, 'str')
context.register_function(_int, 'int')
context.register_function(_patch, 'patch')
# Temporary workaround as YAQL does not provide "where" function for
# dictionaries, and there is no easy way to implement it there.
context.register_function(yaql_builtin.dict_attribution, 'get')