nicolaiarocci/eve — pull request #327 by graffic (2014-04-29 08:59:40+00:00)
Title: Add defaults support for multiple levels

Adds default support for documents with more than one level of data.

Let's see this with some examples. The behaviour till now was the following

```python
schema = {
'title': {
'type': 'string',
'default': 'M.'
},
}
```

Besides that now the user can do `dict` defaults:

```python
schema = {
'others': {
'type': 'dict',
'schema': {
'code': {
'type': 'int',
'default': 100
}
}
}
}
```

And dicts inside lists of random length:

```python
schema = {
'mylist': {
'type': 'list',
'schema': {
'type': 'dict',
'schema': {
'name': {'type': 'string'},
'customer': {
'type': 'boolean',
'default': False
}
}
}
}
}
```

## Issues
Well, I've put the code in the `methods/common.py` file, but I feel that perhaps there is not the best place. Suggestions are welcome for that. Perhaps in an individual module `defaults.py`?