Returns the column family name if it's been defined otherwise, it creates it from the module and class name
(cls, include_keyspace=True)
| 549 | |
| 550 | @classmethod |
| 551 | def column_family_name(cls, include_keyspace=True): |
| 552 | """ |
| 553 | Returns the column family name if it's been defined |
| 554 | otherwise, it creates it from the module and class name |
| 555 | """ |
| 556 | cf_name = protect_name(cls._raw_column_family_name()) |
| 557 | if include_keyspace: |
| 558 | keyspace = cls._get_keyspace() |
| 559 | if not keyspace: |
| 560 | raise CQLEngineException("Model keyspace is not set and no default is available. Set model keyspace or setup connection before attempting to generate a query.") |
| 561 | return '{0}.{1}'.format(protect_name(keyspace), cf_name) |
| 562 | |
| 563 | return cf_name |
| 564 | |
| 565 | |
| 566 | @classmethod |