Module Expr Str Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias identifier ImportFrom alias identifier ImportFrom alias identifier ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body If CompareIn NameLoad TupleLoad Str Str body Return Str orelse Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad decorator_list decorator_list Expr Str Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad Dict Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults vararg body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Str Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Str Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Str Call NameLoad NameLoad Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad NameLoad body Return BoolOpOr CompareIn Str Call NameLoad NameLoad CompareIn Str Call NameLoad NameLoad CompareIn Str Call NameLoad NameLoad CompareIn Str Call NameLoad NameLoad orelse If Call NameLoad NameLoad NameLoad body Return BoolOpOr CompareIn Str Call NameLoad NameLoad CompareIn Str Call NameLoad NameLoad orelse If Call NameLoad NameLoad NameLoad body Return CompareIn Str Call NameLoad NameLoad orelse Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body TryExcept body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Raise AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Index Num ExceptHandler type AttributeLoad NameLoad attr name NameStore body If Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Raise AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Index Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body TryExcept body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Raise AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Index Num ExceptHandler type AttributeLoad NameLoad attr name NameStore body If Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Raise AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Index Num decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults vararg kwarg body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body If BoolOpOr CompareIs AttributeLoad NameLoad attr NameLoad CompareIs AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore IfExp AttributeLoad NameLoad attr Str Call AttributeLoad AttributeLoad NameLoad attr attr Str If NameLoad body TryExcept body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type NameLoad body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad Str If CompareNotEq NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr IfExp AttributeLoad NameLoad attr NameLoad NameLoad Return Call NameLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If BoolOpAnd CompareIsNot AttributeLoad NameLoad attr NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body If BoolOpAnd CompareIsNot AttributeLoad NameLoad attr NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad TryExcept body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad handlers ExceptHandler type NameLoad body Pass orelse Expr Call AttributeLoad NameLoad attr Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot SubscriptLoad NameLoad Index Str body ImportFrom alias Raise Call NameLoad Str Assign NameStore Dict Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Delete SubscriptDel NameLoad Index Str If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index Str If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index Str If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index Str If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index Str Return NameLoad decorator_list decorator_list
N/A N/A 
INSTALL:
    apt-get install postgresql-contrib-9.1

RUN IN DBSHELL
   CREATE EXTENSION IF NOT EXISTS unaccent;

USAGE:

DATABASES = {
    'default': {
        'ENGINE': 'opps.db.backends.postgresql_psycopg2',
        ...
    }
}

SOUTH_DATABASE_ADAPTERS = {
    'default': 'south.db.postgresql_psycopg2'
}

DATABASE_POOL_ARGS = {
    'max_overflow': 10,
    'pool_size': 5,
    'recycle': 300
}
 N/A logging functools partial sqlalchemy event sqlalchemy.pool manage QueuePool psycopg2 InterfaceError ProgrammingError OperationalError django.conf settings django.db.backends.postgresql_psycopg2.base * django.db.backends.postgresql_psycopg2.base DatabaseWrapper Psycopg2DatabaseWrapper django.db.backends.postgresql_psycopg2.base CursorWrapper DjangoCursorWrapper django.db.backends.postgresql_psycopg2.creation DatabaseCreation Psycopg2DatabaseCreation DatabaseOperations N/A DatabaseOperations N/A lookup_cast N/A N/A self lookup_type N/A N/A N/A N/A lookup_type N/A icontains istartswith N/A N/A UPPER(unaccent(%s::text)) N/A N/A N/A N/A N/A super DatabaseOperations self lookup_cast lookup_type N/A N/A N/A 
# Uncomment this class to disable the pool
class DatabaseWrapper(DatabaseWrapper):
    def __init__(self, *args, **kwargs):
        super(DatabaseWrapper, self).__init__(*args, **kwargs)
        self.operators['icontains'] = 'LIKE UPPER(unaccent(%s))'
        self.operators['istartswith'] = 'LIKE UPPER(unaccent(%s))'
        self.ops = DatabaseOperations(self)

# comment everything below to disable the pool
 N/A POOL_SETTINGS DATABASE_POOL_ARGS N/A pool_args N/A getattr settings POOL_SETTINGS N/A N/A db_pool N/A manage Database pool_args N/A log N/A N/A logging getLogger z.pool _log N/A N/A message N/A args N/A N/A N/A N/A log debug message N/A N/A N/A settings DEBUG N/A N/A N/A N/A event listen QueuePool checkout N/A partial _log retrieved from pool N/A N/A N/A event listen QueuePool checkin N/A partial _log returned to pool N/A N/A N/A event listen QueuePool connect N/A partial _log new connection is_disconnect N/A N/A e connection cursor N/A N/A N/A 
    Connection state check from SQLAlchemy:
    https://bitbucket.org/sqlalchemy/sqlalchemy/src/tip/
        lib/sqlalchemy/dialects/postgresql/psycopg2.py
     N/A N/A isinstance e OperationalError N/A N/A N/A N/A terminating connection N/A str e N/A closed the connection N/A str e N/A connection not open N/A str e N/A could not receive data from server N/A str e N/A N/A N/A isinstance e InterfaceError N/A N/A N/A N/A connection already closed N/A str e N/A cursor already closed N/A str e N/A N/A N/A isinstance e ProgrammingError N/A N/A N/A losed the connection unexpectedly N/A str e N/A N/A False N/A CursorWrapper N/A DjangoCursorWrapper N/A N/A 
    A thin wrapper around psycopg2's normal cursor class so that we can catch
    particular exception instances and reraise them with the right types.

    Checks for connection state on DB API error and invalidates
    broken connections.
     __init__ N/A N/A self cursor connection N/A N/A N/A N/A self cursor cursor N/A N/A self connection connection N/A execute N/A N/A self query args N/A None N/A N/A N/A N/A N/A N/A N/A self cursor execute query args N/A N/A N/A N/A Database IntegrityError N/A e N/A N/A N/A utils IntegrityError N/A N/A utils IntegrityError N/A tuple e N/A N/A N/A sys exc_info N/A 2 N/A N/A N/A Database DatabaseError N/A e N/A N/A N/A is_disconnect e N/A N/A self connection connection N/A self cursor N/A N/A N/A N/A log error invalidating broken connection N/A N/A N/A N/A self connection invalidate N/A N/A utils DatabaseError N/A N/A utils DatabaseError N/A tuple e N/A N/A N/A sys exc_info N/A 2 N/A executemany N/A N/A self query args N/A N/A N/A N/A N/A N/A N/A N/A self cursor executemany query args N/A N/A N/A N/A Database IntegrityError N/A e N/A N/A N/A utils IntegrityError N/A N/A utils IntegrityError N/A tuple e N/A N/A N/A sys exc_info N/A 2 N/A N/A N/A Database DatabaseError N/A e N/A N/A N/A is_disconnect e N/A N/A self connection connection N/A self cursor N/A N/A N/A N/A log error invalidating broken connection N/A N/A N/A N/A self connection invalidate N/A N/A utils DatabaseError N/A N/A utils DatabaseError N/A tuple e N/A N/A N/A sys exc_info N/A 2 N/A N/A DatabaseCreation N/A Psycopg2DatabaseCreation N/A destroy_test_db N/A N/A self N/A args kw N/A N/A Ensure conn pool is disposed before trying to drop database. N/A N/A N/A N/A self connection _dispose N/A N/A N/A N/A super DatabaseCreation self destroy_test_db args kw N/A N/A DatabaseWrapper N/A Psycopg2DatabaseWrapper N/A N/A SQLAlchemy FTW. __init__ N/A N/A self N/A args kwargs N/A N/A N/A N/A N/A super DatabaseWrapper self __init__ args kwargs N/A N/A self creation N/A DatabaseCreation self N/A N/A N/A self operators N/A icontains LIKE UPPER(unaccent(%s)) N/A N/A N/A self operators N/A istartswith LIKE UPPER(unaccent(%s)) N/A N/A self ops N/A DatabaseOperations self N/A _cursor N/A N/A self N/A N/A N/A N/A N/A N/A self connection None N/A N/A N/A self connection is_valid False N/A N/A N/A self connection N/A N/A db_pool connect N/A N/A self _get_conn_params N/A N/A N/A N/A self connection set_client_encoding UTF8 N/A tz N/A N/A settings USE_TZ UTC N/A N/A N/A self settings_dict get TIME_ZONE N/A tz N/A N/A N/A N/A get_parameter_status N/A N/A self connection get_parameter_status N/A N/A N/A AttributeError N/A N/A conn_tz None N/A N/A conn_tz N/A get_parameter_status TimeZone N/A N/A conn_tz tz N/A N/A N/A N/A N/A self connection set_isolation_level N/A N/A psycopg2 extensions ISOLATION_LEVEL_AUTOCOMMIT N/A N/A N/A N/A N/A N/A self connection cursor execute N/A N/A N/A self ops set_time_zone_sql N/A tz N/A N/A N/A N/A self connection set_isolation_level N/A self isolation_level N/A N/A N/A self _get_pg_version N/A N/A N/A connection_created send sender N/A self __class__ connection self N/A cursor N/A N/A N/A self connection cursor N/A N/A cursor tzinfo_factory N/A N/A settings USE_TZ utc_tzinfo_factory None N/A N/A CursorWrapper cursor N/A self connection N/A _commit N/A N/A self N/A N/A N/A N/A N/A N/A self connection None N/A N/A self connection is_valid N/A N/A N/A N/A N/A self connection commit N/A _rollback N/A N/A self N/A N/A N/A N/A N/A N/A self connection None N/A N/A self connection is_valid N/A N/A N/A N/A N/A self connection rollback N/A _dispose N/A N/A self N/A N/A N/A Dispose of the pool for this instance, closing all connections. N/A N/A N/A self close N/A conn_params N/A N/A self _get_conn_params N/A key N/A N/A db_pool _serialize conn_params N/A N/A N/A pool N/A N/A db_pool pools N/A key N/A N/A N/A KeyError N/A N/A N/A N/A N/A N/A pool dispose N/A N/A N/A db_pool pools N/A key N/A _get_conn_params N/A N/A self N/A N/A N/A settings_dict N/A self settings_dict N/A N/A N/A settings_dict N/A NAME N/A django.core.exceptions ImproperlyConfigured N/A N/A ImproperlyConfigured settings.DATABASES is improperly configured. Please supply the NAME value. N/A conn_params N/A database N/A settings_dict N/A NAME N/A N/A N/A conn_params update N/A settings_dict N/A OPTIONS N/A N/A autocommit conn_params N/A N/A N/A conn_params N/A autocommit N/A N/A settings_dict N/A USER N/A N/A N/A conn_params N/A user N/A settings_dict N/A USER N/A N/A settings_dict N/A PASSWORD N/A N/A N/A conn_params N/A password N/A settings_dict N/A PASSWORD N/A N/A settings_dict N/A HOST N/A N/A N/A conn_params N/A host N/A settings_dict N/A HOST N/A N/A settings_dict N/A PORT N/A N/A N/A conn_params N/A port N/A settings_dict N/A PORT N/A conn_params N/A N/A