Created
July 22, 2011 11:31
-
-
Save atroche/1099283 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mongoengine import * | |
connect("test") | |
class Thing(EmbeddedDocument): | |
count = IntField() | |
class User(Document): | |
thing = EmbeddedDocumentField(Thing) | |
user = User(thing=Thing(count=1)) | |
user.save() | |
user.reload() # Getting rid of this makes it work | |
user.thing.count = 0 | |
user.save() | |
user.reload() | |
assert user.thing.count is None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment