Skip to content

Instantly share code, notes, and snippets.

@nizox nizox/gist:3176429
Created Jul 25, 2012

Embed
What would you like to do?
class User(Document):
id = IntegerField(aliases=["_id"])
name = StringField()
user = User(name="test")
_id = db.user.insert(user)
user.update_from_dict({ "_id": _id })
class SomeOtherData(Document):
uniqueid = StringField(aliases=["_id"])
data = SomeOtherData(uniqueid=12)
_id = db.data.insert(data)
data.update_from_dict({ "_id": _id })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.