summaryrefslogtreecommitdiff
path: root/example_project/settings.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-10-01 18:50:02 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-10-01 18:50:02 +0200
commit4392454570b36c1e0bf9c0d4a365efb99c8b8342 (patch)
treefadcd9d09ac5fa97db0a28ccabdbb2ecbffaa831 /example_project/settings.py
parent0c29c68c09bf45306c02658a31e2f99581169cb1 (diff)
downloadIshtar-4392454570b36c1e0bf9c0d4a365efb99c8b8342.tar.bz2
Ishtar-4392454570b36c1e0bf9c0d4a365efb99c8b8342.zip
Manage column customization on custom app
Diffstat (limited to 'example_project/settings.py')
-rw-r--r--example_project/settings.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/example_project/settings.py b/example_project/settings.py
index db9a3ee64..a27046f5f 100644
--- a/example_project/settings.py
+++ b/example_project/settings.py
@@ -4,6 +4,7 @@
import os
import sys
+from importlib import import_module
DEBUG = False
DEBUG_TOOLBAR = False
@@ -265,8 +266,16 @@ try:
except ImportError, e:
print('Unable to load local_settings.py:', e)
+TABLE_COLS = {} # allow to overload table col settings on extra module
+COL_LABELS = {}
+
if MAIN_APP:
INSTALLED_APPS.insert(INSTALLED_APPS.index("ishtar_common"), MAIN_APP)
+ extra_module = import_module(MAIN_APP + '.extra_settings')
+ if hasattr(extra_module, 'TABLE_COLS'):
+ TABLE_COLS = extra_module.TABLE_COLS
+ if hasattr(extra_module, 'COL_LABELS'):
+ TABLE_COLS = extra_module.COL_LABELS
TESTING = sys.argv[1:2] == ['test']