示例#1
0
 class Payment(self.engine.Document):
     __collection_name__ = 'payments'
     _id = MongoId()
     unique_field = MongoString(unique=True)
 class User(self.engine.Document):
     _id = MongoId()
     name = MongoString()
     the_number = MongoNumber()
 class User(self.engine.Document):
     __collection_name__ = 'users'
     _id = MongoId()
     name = MongoString()
     the_number = MongoNumber()
 class User(self.engine.Document):
     __collection_name__ = 'users'
     _id = MongoId(serialize=False)
     first_name = MongoString()
     last_name = MongoString()
 class User(self.engine.Document):
     __collection_name__ = 'users'
     _id = MongoId()
     name = MongoString(serialize_as='theName')
示例#6
0
 class Address(MongoObject):
     street = MongoString(default='Circle street')
     house_number = MongoNumber()
示例#7
0
 class User(self.engine.Document):
     __collection_name__ = 'users'
     _id = MongoId()
     name = MongoString(default='Tammy')
     address = Address()
示例#8
0
 class Address(MongoObject):
     street = MongoString()
     house_number = MongoNumber(serialize_as='housenumber')
示例#9
0
 class User(self.engine.Document):
     __collection_name__ = 'users'
     _id = MongoId()
     name = MongoString()
     address = Address(serialize_as='theaddress')
示例#10
0
 class Address(MongoObject):
     street = MongoString()
     house_number = MongoNumber(serialize=False)
示例#11
0
 class User(self.engine.Document):
     __collection_name__ = 'users'
     _id = MongoId(serialize=False)
     name = MongoString()
     address = Address()
示例#12
0
 class User(self.engine.Document):
     __collection_name__ = 'users'
     _id = MongoId(serialize=False)
     name = MongoString()
     addresses = MongoList(containing_type=Address)
示例#13
0
 class Address(MongoObject):
     street = MongoString()
     house_number = MongoNumber()
示例#14
0
 class User(self.engine.Document):
     __collection_name__ = 'users'
     _id = MongoId(serialize=False)
     name = MongoString()
     favorite_colors = MongoList(containing_type=str)
示例#15
0
 class User(self.engine.Document):
     __collection_name__ = 'users'
     _id = MongoId()
     name = MongoString()
     address = MongoForeignKey()
示例#16
0
 class Address(MongoObject):
     street = MongoString(nullable=False)
     house_number = MongoNumber()