示例#1
0
class Simple(model.RootObjectModel):
    i = model.Integer(thrift_id=1)

    @classmethod
    def generate_test_object(cls):
        obj = cls()
        obj.i = 123
        return obj
示例#2
0
class A(model.RootObjectModel):
    s = model.String(thrift_id=1)
    i = model.Integer(thrift_id=2)
    f = model.Float(thrift_id=3)
    bt = model.Boolean(thrift_id=4)
    bf = model.Boolean(thrift_id=5)

    def __eq__(self, other):
        return self.s == other.s and self.i == other.i and self.f == other.f
示例#3
0
class Address(model.Model):
    street = model.String(thrift_id=1)
    number = model.Integer(thrift_id=2)
    postal_code = model.Integer(thrift_id=3)
    city = model.String(thrift_id=4)
示例#4
0
 class B(model.Model):
     i = model.Integer(thrift_id=1)
示例#5
0
 class Simple(base):
     i = model.Integer()
     s = model.String()
     b = model.Boolean()