I'm having the same problem, and the solution on this thread doesn't
work for me.
Here's my code:
@con.register
class UserInfo(Document):
use_dot_notation = True
structure = {
'email_addresses': [{
'email': unicode,
'verified': bool,
}],
}
required_fields = []
default_values = {
'email_addresses': [{
'verified': True,
}],
}
It raises this exception when I instantiate a new document:
ValueError: Error in default_values: can't find email_addresses in
structure
I've also tried 'email_addresses.verified': False, in default_values.
That fails differently, when I call save(), with:
mongokit.schema_document.StructureError: missed fields : ['verified']
I'm using MongoKit 0.6, from PyPi.
-matt
On Mar 8, 12:09 pm, Nicolas Clairon <
clai...@gmail.com> wrote:
> You may try something like that:
>
> default_values = { 'items': [{'id': 3, 'data':'foo'}] }
>