Skip to content

Commit 1ed8880

Browse files
authored
Merge pull request #4434 from arnaud-morvan/db_manager_fix_schema_g
Db manager fix schema g
2 parents 2da64e4 + 44731f2 commit 1ed8880

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

python/plugins/db_manager/db_plugins/connector.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ def quoteString(self, txt):
213213
def getSchemaTableName(self, table):
214214
if not hasattr(table, '__iter__') and not isinstance(table, str):
215215
return (None, table)
216-
elif len(table) < 2:
216+
if isinstance(table, str):
217+
table = table.split('.')
218+
if len(table) < 2:
217219
return (None, table[0])
218220
else:
219221
return (table[0], table[1])

python/plugins/db_manager/db_plugins/postgis/plugins/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,19 @@
2121
"""
2222

2323
import os
24+
from importlib import import_module
2425

2526
current_dir = os.path.dirname(__file__)
2627

2728

28-
def load(dbplugin, mainwindow):
29+
def load(db, mainwindow):
2930
for name in os.listdir(current_dir):
3031
if not os.path.isdir(os.path.join(current_dir, name)):
3132
continue
33+
if name in ('__pycache__'):
34+
continue
3235
try:
33-
exec(u"from .%s import load" % name)
36+
plugin_module = import_module('.'.join((__package__, name)))
3437
except ImportError:
3538
continue
36-
37-
load(dbplugin, mainwindow)
39+
plugin_module.load(db, mainwindow)

0 commit comments

Comments
 (0)