spiral-project/daybed — pull request #193 by leplatrem (2014-08-08 09:39:28+00:00)
Title: (WIP) Group field

I'm stuck with group fields, and I'm currently thinking of getting rid of them.

My first idea was just to allow grouping of fields, in a way that does not affect their individual validation at all.

For example, the following model :

```javascript
{name: 'person',
fields: [
{name: 'age', type: 'int'},
{description: 'address',
type: 'group',
fields: [{name: 'street', type: 'string'},
{name: 'city', type: 'string'}]
}
]
}
```
could validate this record
```javascript
{age: 12, street: 'bakery', city: 'london'}
```

I must admit that the group field type I had in mind belongs more to the presentation layer (grouping widgets in forms) than the model layer.

The current implementation is completely wrong : it does not validate at all ! (see #189, #192)

I tried to hack around, but I cannot find a way to flatten the fields list (i.e. expending the fields at the model level with the ones from the group fields).

And if we validate in a dict (e.g. ``{age: 12, '': {street: 'bakery', city: 'london'}}``), then there is no difference with the ``object`` field, which is well tested and rather intuitive...

Any idea ? Opposition to ``group`` field type removal ?