Skip to content

Fields

So far we only have 5 types available and 5 special types: ForeignKey, OneToMany, OneToOne and ManyToMany.

These special types are for relationships between database tables.

Tip

For more details on relationship fields, see here

Common Types:

String

1
2
3
4
String(
    unique: bool = False, primary_key: bool = False, not_null: bool = False,
    default_value = None
)
  • Type in database postgres: TEXT
  • Type in database sqlite: TEXT
  • Type: str

Integer

1
2
3
4
Integer(
    min_value: int = None, unique: bool = False, primary_key: bool = False,
    auto_increment: bool = False, not_null: bool = False, default_value = None
)
  • Type in database postgres: INTEGER
  • Type in database sqlite: INTEGER
  • Type: int

BigInteger

1
2
3
BigInteger(
    unique: bool = False, primary_key: bool = False, default_value = None
)
  • Type in database postgres: BIGINT
  • Type in database sqlite: BIGINT
  • Type: int

Varchar

1
2
3
4
Varchar(
    length: int, unique: bool = False, primary_key: bool = False,
    default_value = None
)
  • Type in database postgres: VARCHAR
  • Type in database sqlite: VARCHAR
  • Type: str

Boolean

1
Boolean(not_null: bool = False, default_value = None)
  • Type in database postgres: BOOLEAN
  • Type in database sqlite: INTEGER
  • Type: bool

Timestamp

1
Timestamp()
  • Type in database postgres: TIMESTAMP
  • Type in database sqlite: TEXT
  • Type: datetime