'Change the context on-the-fly of the Model class (keyspace, connection)'

def using(self, keyspace=None, connection=None):

    if (connection and self._batch):
        raise CQLEngineException('Cannot    specify    a    connection    on    model    in    batch    mode.')
    clone = copy.deepcopy(self)
    if keyspace:
        from cassandra.cqlengine.models import _clone_model_class
        clone.model = _clone_model_class(self.model, {'__keyspace__': keyspace})
    if connection:
        clone._connection = connection
    return clone
