From 6399d962fcdfcf0648094e3e6cae155a8a3a967a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 29 May 2019 09:06:42 +0200 Subject: Manage alternate configuration for find table col for ope --- archaeological_finds/views.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'archaeological_finds/views.py') diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py index 4bd67e441..b8a23367b 100644 --- a/archaeological_finds/views.py +++ b/archaeological_finds/views.py @@ -20,6 +20,7 @@ from collections import OrderedDict import json +from django.conf import settings from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.db.models import Q @@ -51,8 +52,16 @@ from archaeological_finds import wizards get_find = get_item(models.Find, 'get_find', 'find', search_form=forms.FindSelect) + +def get_table_cols_for_ope(): + tb_key = (models.Find.SLUG, "TABLE_COLS_FOR_OPE") + if tb_key not in settings.TABLE_COLS: + return models.Find.TABLE_COLS_FOR_OPE + return settings.TABLE_COLS[tb_key] + + get_find_for_ope = get_item(models.Find, 'get_find', 'find', - own_table_cols=models.Find.TABLE_COLS_FOR_OPE) + own_table_cols=get_table_cols_for_ope()) get_find_for_treatment = get_item( models.Find, 'get_find', 'find', -- cgit v1.2.3