Projet

Général

Profil

0001-engine-add-setting-for-postgresql-init-statements-38.patch

Benjamin Dauvergne, 12 décembre 2019 15:42

Télécharger (1,28 ko)

Voir les différences:

Subject: [PATCH] engine: add setting for postgresql init statements (#38462)

 bijoe/engine.py   | 3 +++
 tests/settings.py | 3 +++
 2 files changed, 6 insertions(+)
bijoe/engine.py
23 23
import psycopg2
24 24

  
25 25
from django.core.cache import cache
26
from django.conf import settings
26 27
from django.utils.translation import ugettext_lazy as _
27 28

  
28 29
from . import schemas
......
526 527
            with connection.cursor() as cursor:
527 528
                search_path = ', '.join(['%s' % namespace for namespace in self.warehouse.search_path])
528 529
                cursor.execute('SET SEARCH_PATH = %s' % search_path)
530
                for statement in getattr(settings, 'BIJOE_INIT_SQL', []):
531
                    cursor.execute(statement)
529 532
                yield cursor
tests/settings.py
1 1
BIJOE_CACHE = False
2
BIJOE_INIT_SQL = [
3
    'SET lc_time = \'fr_FR.UTF-8\'',
4
]
2
-