Columns

A Column represents a column on a database table.

ColumnType MySQL
IntegerColumn integer
TinyIntegerColumn tinyint
BigIntegerColumn bigint
SmallIntegerColumn smallint
BooleanColumn tinyint
PKeyColumn integer
FKeyColumn integer
FloatColumn real
DoubleColumn double precision
DateTimeColumn datetime
DateColumn date
TimeColumn time
CharColumn varchar
TextColumn longtext
DictColumn longtext

Special columns

Column Type Database Information
DictColumn longtext Represents a dict instance
VirtualColumn None Represents a Table instance

Columns parameters

Parameter Description
null = False boolean indicating if null values are allowed to be stored.
index = False boolean indicating to create an index on this column.
unique = False boolean indicating to create a unique index on this column.
default = None any value to use as a default.
pkey = False whether this field is the primary key for the table.
db_column = None string representing the database column to use if different.
setter callback function used when setting a column value. setter(val)
getter callback function used when getting a column value. getter(val)

Special parameters

Column Type Special Paramaters
CharColumn max_length
DateTimeColumn format
DateColumn format
TimeColumn format
FKeyColumn reference
FKeyColumn required