| 88 | |
| 89 | |
| 90 | class Column(object): |
| 91 | |
| 92 | # the cassandra type this column maps to |
| 93 | db_type = None |
| 94 | value_manager = BaseValueManager |
| 95 | |
| 96 | instance_counter = 0 |
| 97 | |
| 98 | _python_type_hashable = True |
| 99 | |
| 100 | primary_key = False |
| 101 | """ |
| 102 | bool flag, indicates this column is a primary key. The first primary key defined |
| 103 | on a model is the partition key (unless partition keys are set), all others are cluster keys |
| 104 | """ |
| 105 | |
| 106 | partition_key = False |
| 107 | |
| 108 | """ |
| 109 | indicates that this column should be the partition key, defining |
| 110 | more than one partition key column creates a compound partition key |
| 111 | """ |
| 112 | |
| 113 | index = False |
| 114 | """ |
| 115 | bool flag, indicates an index should be created for this column |
| 116 | """ |
| 117 | |
| 118 | custom_index = False |
| 119 | """ |
| 120 | bool flag, indicates an index is managed outside of cqlengine. This is |
| 121 | useful if you want to do filter queries on fields that have custom |
| 122 | indexes. |
| 123 | """ |
| 124 | |
| 125 | db_field = None |
| 126 | """ |
| 127 | the fieldname this field will map to in the database |
| 128 | """ |
| 129 | |
| 130 | default = None |
| 131 | """ |
| 132 | the default value, can be a value or a callable (no args) |
| 133 | """ |
| 134 | |
| 135 | required = False |
| 136 | """ |
| 137 | boolean, is the field required? Model validation will raise and |
| 138 | exception if required is set to True and there is a None value assigned |
| 139 | """ |
| 140 | |
| 141 | clustering_order = None |
| 142 | """ |
| 143 | only applicable on clustering keys (primary keys that are not partition keys) |
| 144 | determines the order that the clustering keys are sorted on disk |
| 145 | """ |
| 146 | |
| 147 | discriminator_column = False |
no outgoing calls