mongokit
mongokit copied to clipboard
`Document` init from dict should update from `default_values` first
When specified doc for Document, i found the generated object not has default_values if the doc not have. For example:
class MyDoc(Document):
structure={
'name': unicode,
'phone': basestring
}
default_values = {
'phone': ''
}
Then t=MyDoc({'name': 'xxx'}) will generate a dict not include default phone at all.
I think there should be a para like set_default=True to include all default values... It is convenient for create model from POST data.