better symlink support for option.dict()

This commit is contained in:
2019-04-17 19:13:17 +02:00
parent 63094f7e54
commit 829247e79f
7 changed files with 138 additions and 35 deletions

View File

@ -0,0 +1,4 @@
{
"options.unicode1": "test",
"options.unicode2": "test"
}

View File

@ -0,0 +1,4 @@
{
"options.unicode1": "val",
"options.unicode2": "val"
}

View File

@ -0,0 +1,42 @@
{
"schema": {
"options": {
"name": "options",
"properties": {
"options.unicode1": {
"name": "options.unicode1",
"type": "string",
"value": "test",
"title": "Unicode 1"
},
"options.unicode2": {
"name": "options.unicode2",
"type": "symlink",
"opt_path": "options.unicode1",
"title": "Unicode 1"
}
},
"type": "object",
"title": "Common configuration"
}
},
"model": {
"options.unicode1": {
"value": "test",
"owner": "default"
}
},
"form": {
"options.unicode1": {
"clearable": true,
"type": "input"
},
"null": [
{
"title": "Configurer",
"type": "submit"
}
]
},
"version": "1.0"
}

View File

@ -0,0 +1,4 @@
{"cmd": "config.option('options.unicode1').value.set('val')",
"body": {"updates": [{"action": "modify",
"name": "options.unicode1",
"value": "val"}]}}

View File

@ -0,0 +1,12 @@
"""two unicode options
"""
from tiramisu.option import StrOption, OptionDescription, SymLinkOption
def get_description():
"""generate description for this test
"""
option1 = StrOption('unicode1', "Unicode 1", 'test')
option2 = SymLinkOption('unicode2', option1)
descr1 = OptionDescription("options", "Common configuration", [option1, option2])
descr = OptionDescription("unicode2_symlink", "One unicode, one symlink", [descr1])
return descr

View File

@ -0,0 +1,11 @@
{
"updates": [
"options.unicode1"
],
"model": {
"options.unicode1": {
"value": "val",
"owner": "user"
}
}
}