Skip to content
Browse files

An example of using MongoAlchemy to turn a JSON object into a document

  • Loading branch information...
1 parent e3a1f36 commit 71b8fa883f5d776d37c6faf700835e46d3645b90 @jeffjenkins committed Sep 29, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 examples/json.py
View
9 examples/json.py
@@ -0,0 +1,9 @@
+from mongoalchemy.document import Document
+from mongoalchemy.fields import StringField
+
+class A(Document):
+ b = StringField()
+ c = StringField()
+
+a = A.unwrap({'b' : 'some val 1', 'c' : 'some val 2'})
+print a.b, a.c

0 comments on commit 71b8fa8

Please sign in to comment.
Something went wrong with that request. Please try again.