Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

src/d/j/django_pooled-HEAD/psycopg2/base.py   django_pooled(Download)
from django_pooled.base import PoolKey, PoolObject, PoolReleaser, CreationWrapper, pool
from django.db.backends.postgresql_psycopg2.base import DatabaseWrapper as DjangoDBWrapper
import psycopg2
 
class DatabaseWrapper(DjangoDBWrapper):
    def get_new_connection(self, conn_params):
        key = PoolKey(self.alias, self.settings_dict)
        pooled = pool.acquire_connection(key)
        if pooled:
            self.pool_releaser.pool_object = pooled