Closed Natim closed 9 years ago
For the linkedTo
conditionnal validation feature, let see if we want to add it right now or use two documents at the moment.
For this ticket I will focus on list of docs.
Is this already the group
field type?
{"definition": {
"title": "Keep — Todo",
"description": "Store user text kept card.",
"fields": [
{
"name": "title",
"type": "string",
"label": "Title"
},
{
"name": "tasks",
"type": "group",
"label": "Tasks",
"description": "List of todo list's tasks.",
"fields": [
{
"name": "label",
"type": "string",
"label": "Label"
},
{
"name": "done",
"type": "boolean",
"label": "Check when done!"
}
]
}
]
}
}
This works, also this doesn't:
{
"title": "Today",
"tasks": [
{"label": "Walk the dog", "done": true},
{"label": "Clean the car", "done": false},
{"label": "Buy a new carpet", "done": false}
]
}
groups is the way to go.
Interesting : groups are not relevant for what you describe (see list
field and its test suite).
But I realize that the groups
test suite is the only one that does not test records validation! Which leads me to think that the validation is not performed properly and let you save the records you described above...
I'd like to be able to store and validate something like so:
In other words the definition it'd like would looks like this:
NB: By default a list type without definition should be a list of strings.