Exemplo n.º 1
0
    class Challenge(trol.Model):
        def __init__(self, name):
            self.id = name

        certificates = trol.Set(typ=trol.Model)
        strategies = trol.Set(typ=str)
        ready = trol.Property(typ=bool, alwaysfetch=True)
Exemplo n.º 2
0
class Db(trol.Database):
    challenges = trol.Set(typ=trol.Model)

    class Challenge(trol.Model):
        def __init__(self, name):
            self.id = name

        certificates = trol.Set(typ=trol.Model)
        ready = trol.Property(typ=bool)

    class Certificate(trol.Model):
        def __init__(self, cn, text=None):
            self.id = cn
            if text:
                self.text = text

        text = trol.Property()
Exemplo n.º 3
0
    class Challenge(trol.Model):
        def __init__(self, name):
            self.id = name

        certificates = trol.Set(typ=trol.Model)
        ready = trol.Property(typ=bool)