Skip to content

Instantly share code, notes, and snippets.

@nizox
Created July 25, 2012 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nizox/3176429 to your computer and use it in GitHub Desktop.
Save nizox/3176429 to your computer and use it in GitHub Desktop.
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