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))
class Sub(TestModel): b = String() c = String(default='foo')
class TestModel(Model): a = String() b = String(default='default')
class MyModel(SuperModel): table = FakeTable x = String(pk=True)
class MyModel(SuperModel): x = String(pk=True)
class MyModel(Model): attr = String(nullable=True, default=None, validators=(lambda val: val in ["a", "b"], ))
class TestModel(RedisHash): db_name = DB_NAME key = String() test_int = Integer() test_str = String()
class TestModel(Model): my_val = String(validators=(lambda val: len(val) < 4,))
class TestModel(Model): my_val = String()
class MyModel(SuperModel): table = MyTable field1 = String(pk=True)
class SubModel(MyModel): field2 = String() field4 = String(pk=True) field5 = String()
class MyModel(MyDriver): key = String()