def setUpClass(cls):
        cls.connection = get_cassandra_connection()
        cls.all_models = []
        apps = get_installed_apps()
        for app in apps:
            cls.all_models.extend(get_cql_models(app))

        cls.all_django_tables = \
            [model.column_family_name(include_keyspace=False)
             for model in cls.all_models]
 def setUp(self):
     self.cassandra_connection = get_cassandra_connection()
     self.connection = CassandraConnection(
         **self.cassandra_connection.settings_dict)
Ejemplo n.º 3
0
 def setUp(self):
     self.connection = get_cassandra_connection()
     self.keyspace = self.connection.settings_dict['NAME']
 def setUp(self):
     self.cassandra_connection = get_cassandra_connection()
     self.connection = self.cassandra_connection.connection
     self.cassandra_connection.connect()
 def setUp(self):
     self.cassandra_connection = get_cassandra_connection()
     self.connection = CassandraConnection(
         **self.cassandra_connection.settings_dict)
 def setUp(self):
     self.cassandra_connection = get_cassandra_connection()
     self.connection = self.cassandra_connection.connection
     self.cassandra_connection.connect()
from django_cassandra_engine.utils import get_cassandra_connection

cassandra_connection = get_cassandra_connection()

try:
    from uwsgidecorators import postfork
except ImportError:
    # We're not in a uWSGI context, no need to hook Cassandra session
    # initialization to the postfork event.
    if cassandra_connection is not None:
        cassandra_connection.connect()
else:

    @postfork
    def cassandra_init():
        """ Initialize a new Cassandra session in the context.

        Ensures that a new session is returned for every new request.
        """
        if cassandra_connection is not None:
            cassandra_connection.reconnect()
Ejemplo n.º 8
0
from django_cassandra_engine.utils import get_cassandra_connection

cassandra_connection = get_cassandra_connection()


try:
    from uwsgidecorators import postfork
except ImportError:
    # We're not in a uWSGI context, no need to hook Cassandra session
    # initialization to the postfork event.
    if cassandra_connection is not None:
        cassandra_connection.connect()
else:
    @postfork
    def cassandra_init():
        """ Initialize a new Cassandra session in the context.

        Ensures that a new session is returned for every new request.
        """
        if cassandra_connection is not None:
            cassandra_connection.reconnect()