1.7 KiB
cassandra.cqlengine.columns
- Column types for object mapping models
cassandra.cqlengine.columns
Columns
Columns in your models map to columns in your CQL table. You define CQL columns by defining column attributes on your model classes. For a model to be valid it needs at least one primary key column and one non-primary key column.
Just as in CQL, the order you define your columns in is important, and is the same order they are defined in on a model's corresponding table.
Each column on your model definitions needs to be an instance of a Column class.
Column(**kwargs)
primary_key
partition_key
index
db_field
default
required
clustering_order
polymorphic_key
discriminator_column
static
Column Types
Columns of all types are initialized by passing .Column
attributes to the
constructor by keyword.
Ascii(**kwargs)
BigInt(**kwargs)
Blob(**kwargs)
Bytes(**kwargs)
Boolean(**kwargs)
Counter
Date(**kwargs)
DateTime(**kwargs)
Decimal(**kwargs)
Float
Integer(**kwargs)
List
Map
Set
Text
TimeUUID(**kwargs)
UUID(**kwargs)
VarInt(**kwargs)