Open akap97 opened 3 years ago
For example Model.objects.using('db2').filter(...)
For example
Model.objects.using('db2').filter(...)
It is giving me
cassandra.cqlengine.CQLEngineException: Connection name '<object object at 0x7fd0fe35d0a0>' doesn't exist in the registry.
For example
Model.objects.using('db2').filter(...)
It is giving me:
cassandra.cqlengine.CQLEngineException: Connection name '<object object at 0x7fd0fe35d0a0>' doesn't exist in the registry.
Please take a look at following example from testproject: https://github.com/r4fek/django-cassandra-engine/blob/f6d74090d560c7e9d86877051bb693d342de10b7/testproject/multiapp/models.py https://github.com/r4fek/django-cassandra-engine/blob/f6d74090d560c7e9d86877051bb693d342de10b7/testproject/settings/multi_cassandra.py#L34
Please take a look at following example from testproject: https://github.com/r4fek/django-cassandra-engine/blob/f6d74090d560c7e9d86877051bb693d342de10b7/testproject/multiapp/models.py
I am creating models by inheriting DjangoCassandraModel not models.Model(as in example project). DjangoCassandraModel does not have __connection__
property. Also is it possible to specify the connection while hitting the APIs and not in the model itself?
I have multiple cassandra configurations. my settings.py is as follows:
DATABASES = { 'db1': { 'ENGINE': 'django_cassandra_engine', 'NAME': 'keyspace1', 'HOST': 'host1', 'PORT': port1, 'OPTIONS': { 'replication': { 'strategy_class': 'SimpleStrategy', 'replication_factor': 'factor1' } } } 'db2': { 'ENGINE': 'django_cassandra_engine', 'NAME': 'keyspace2', 'HOST': 'host2', 'PORT': port2, 'OPTIONS': { 'replication': { 'strategy_class': 'SimpleStrategy', 'replication_factor': 'factor2' } } } } ...and so on
How to programmatically connect to different cassandra configurations when querying cassandra models. DB router is not working with cassandra.