Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Document init from dict should update from default_values first #239

Open
YiuTerran opened this issue Apr 9, 2015 · 0 comments
Open

Document init from dict should update from default_values first #239

YiuTerran opened this issue Apr 9, 2015 · 0 comments

Comments

@YiuTerran
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant