Re: using() not able to switch keyspace on the fly.

2020-05-18 Thread Alan Boudreault
You can use `DataModel.objects.using().create()` or use another model for this purpose. See the ContextQuery utility: https://docs.datastax.com/en/developer/python-driver/3.23/cqlengine/connections/#context-manager https://docs.datastax.com/en/developer/python-driver/3.23/api/cassandra/cqlengine/q

Re: using() not able to switch keyspace on the fly.

2020-05-17 Thread Bimal Gangawal
But I am not able to save the row here using datamodel.objects.using(keyspace="tb1").save() What is the preferred alternative to achieve this ? On Sat, May 16, 2020, 7:37 AM Alan Boudreault wrote: > Hello Bimal, > > Due to some internal limitations, you can only switch the keyspace on the > fly

Re: using() not able to switch keyspace on the fly.

2020-05-15 Thread Alan Boudreault
Hello Bimal, Due to some internal limitations, you can only switch the keyspace on the fly of a ModelQuerySet, not a model instance. This should work: DataModel.objects.using(keyspace="tb1") Alan On Fri, May 15, 2020 at 5:00 AM Bimal Gangawal wrote: > Hi, > > I am new to cassandra and using p

using() not able to switch keyspace on the fly.

2020-05-15 Thread Bimal Gangawal
Hi, I am new to cassandra and using python to insert data into cassandra (cassandra-driver==3.23.0). https://docs.datastax.com/en/developer/python-driver/3.23/cqlengine/connections/ In this document i found that we can use using() method to change the keyspace and connection on the fly but while d