class User(UserType):
    # We use Date and Time to ensure to_python
    # is called for these columns
    age = Integer()
    date_param = Date()
    map_param = Map(Integer, Time)
    list_param = List(Date)
    set_param = Set(Date)
    tuple_param = Tuple(Date, Decimal, Boolean, VarInt, Double, UUID)
Ejemplo n.º 2
0
    class DatetimeTest(Model):

        test_id = Integer(primary_key=True)
        created_at = DateTime()
Ejemplo n.º 3
0
    class IntegerTest(Model):

        test_id = UUID(primary_key=True, default=lambda: uuid4())
        value = Integer(default=0, required=True)
Ejemplo n.º 4
0
    class TimeUUIDTest(Model):

        test_id = Integer(primary_key=True)
        timeuuid = TimeUUID(default=uuid1())
Ejemplo n.º 5
0
    class UUIDTest(Model):

        test_id = Integer(primary_key=True)
        a_uuid = UUID(default=uuid4())
Ejemplo n.º 6
0
    class DecimalTest(Model):

        test_id = Integer(primary_key=True)
        dec_val = Decimal()
Ejemplo n.º 7
0
    class VarIntTest(Model):

        test_id = Integer(primary_key=True)
        bignum = VarInt(primary_key=True)
Ejemplo n.º 8
0
    class BoolValidationTest(Model):

        test_id = Integer(primary_key=True)
        bool_column = Boolean()
Ejemplo n.º 9
0
    class BoolDefaultValueTest(Model):

        test_id = Integer(primary_key=True)
        stuff = Boolean(default=True)
class UserModel(Model):
    test_id = Integer(primary_key=True)
    class_param = UserDefinedType(User)
 class DataTypeTest(Model):
     test_id = Integer(primary_key=True)
     class_param = cls.db_klass()