Пример #1
0
class Sub(model.Model):
    s = model.String(thrift_id=1)

    def __eq__(self, other):
        if self and other:
            return self.s == other.s
        else:
            return not self and not other
Пример #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 Parent(model.RootObjectModel):
    s = model.String(thrift_id=1)
    b = model.Object(Sub, thrift_id=2)

    def __eq__(self, other):
        return self.s == other.s and self.b == other.b
Пример #4
0
class Company(model.RootObjectModel):
    name = model.String(thrift_id=1)
    url = model.String(thrift_id=2)
    employees = model.List(model.Object(Employee), thrift_id=3)
Пример #5
0
class Employee(model.Model):
    first_name = model.String(thrift_id=1)
    last_name = model.String(thrift_id=2)
    email_addresses = model.List(model.String(), thrift_id=3)
    address = model.Object(Address, thrift_id=4)
Пример #6
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)
Пример #7
0
class BarModel(model.Model):
    baz = model.String(thrift_id=1)
Пример #8
0
 class B(model.RootObjectModel):
     s = model.String(thrift_id=1)
Пример #9
0
 class Simple(base):
     i = model.Integer()
     s = model.String()
     b = model.Boolean()