namlook/mongokit — Issue #71: get missing values from defaults
Author: matejcik
Created: 2011-12-20 14:22:20+00:00
State: open

it would be nice to have something like this:

```python
class User(Document):
__collection__ = 'users'
structure = {
'name': unicode,
'password': unicode,
'description': unicode,
}
default_values = { 'description': u'i have not filled in a description' }
use_transparent_defaults = True

u1 = fetch_user_with_description()
print u1.description # prints value from db
u2 = fetch_user_without_description()
print u2.description # takes value from default_values
```

this looks like a nice alternative to migration suppport for schemaless documents