Example #1
0
    class TestModel(RedisHash):
        db_name = DB_NAME
        test_int = Integer()
        test_str = String()

        @property
        def key(self):
            return '{}|{}'.format(self.test_str, str(self.test_int))
Example #2
0
 class Sub(TestModel):
     b = String()
     c = String(default='foo')
Example #3
0
 class TestModel(Model):
     a = String()
     b = String(default='default')
Example #4
0
 class MyModel(SuperModel):
     table = FakeTable
     x = String(pk=True)
Example #5
0
 class MyModel(SuperModel):
     x = String(pk=True)
Example #6
0
 class MyModel(Model):
     attr = String(nullable=True,
                   default=None,
                   validators=(lambda val: val in ["a", "b"], ))
Example #7
0
 class TestModel(RedisHash):
     db_name = DB_NAME
     key = String()
     test_int = Integer()
     test_str = String()
Example #8
0
 class TestModel(Model):
     my_val = String(validators=(lambda val: len(val) < 4,))
Example #9
0
 class TestModel(Model):
     my_val = String()
Example #10
0
 class MyModel(SuperModel):
     table = MyTable
     field1 = String(pk=True)
Example #11
0
 class SubModel(MyModel):
     field2 = String()
     field4 = String(pk=True)
     field5 = String()
Example #12
0
 class MyModel(MyDriver):
     key = String()