engine: add setting for postgresql init statements (#38462)
This commit is contained in:
parent
4f9c50badd
commit
79a965f328
|
@ -23,6 +23,7 @@ import hashlib
|
|||
import psycopg2
|
||||
|
||||
from django.core.cache import cache
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from . import schemas
|
||||
|
@ -526,4 +527,6 @@ class Engine(object):
|
|||
with connection.cursor() as cursor:
|
||||
search_path = ', '.join(['%s' % namespace for namespace in self.warehouse.search_path])
|
||||
cursor.execute('SET SEARCH_PATH = %s' % search_path)
|
||||
for statement in getattr(settings, 'BIJOE_INIT_SQL', []):
|
||||
cursor.execute(statement)
|
||||
yield cursor
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
BIJOE_CACHE = False
|
||||
BIJOE_INIT_SQL = [
|
||||
'SET lc_time = \'fr_FR.UTF-8\'',
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue