Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Cassandra engine - how to define table name

I am using Django Cassandra and I have defined my model, which I have this to name a table:

    class Meta:
    db_table = "table_name"

However, Cassandra doesn't create the table with my custom name. What am I missing?

like image 964
user907988 Avatar asked Apr 17 '19 07:04

user907988


1 Answers

https://datastax.github.io/python-driver/api/cassandra/cqlengine/models.html

table_name = None Optional. Sets the name of the CQL table for this model. If left blank, the table name will be the name of the model, with it’s module name as it’s prefix. Manually defined table names are not inherited.

class Meta:
    __table_name__ = "table_name"
like image 138
erolkaya84 Avatar answered Nov 05 '22 07:11

erolkaya84