summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-03-15 10:00:12 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-03-15 10:00:12 +0100
commit145e2100b001dcb682b0d60f02dcad95fb5bf1db (patch)
tree783b84ab3738d0e43a4144f02748b4ef9b107080 /ishtar_common
parentb492cb324e76fcef3c1f9444880bc3e8d98d621b (diff)
downloadIshtar-145e2100b001dcb682b0d60f02dcad95fb5bf1db.tar.bz2
Ishtar-145e2100b001dcb682b0d60f02dcad95fb5bf1db.zip
Refactoring: EXTRA_FULL_FIELDS_LABELS -> COL_LABELS (with merge) (refs #3491)
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/models.py2
-rw-r--r--ishtar_common/views.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index ca6ba36c9..35608abdf 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -102,7 +102,7 @@ class Imported(models.Model):
class ValueGetter(object):
_prefix = ""
GET_VALUES_EXTRA = []
- EXTRA_FULL_FIELDS_LABELS = {}
+ COL_LABELS = {}
def get_values(self, prefix=''):
if not prefix:
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index 95b7689ec..cbf27c8e7 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -1115,9 +1115,9 @@ def get_item(model, func_name, default_name, extra_request_keys=[],
for field_name in table_cols:
if type(field_name) in (list, tuple):
field_name = u" & ".join(field_name)
- if hasattr(model, 'EXTRA_FULL_FIELDS_LABELS') and\
- field_name in model.EXTRA_FULL_FIELDS_LABELS:
- field = model.EXTRA_FULL_FIELDS_LABELS[field_name]
+ if hasattr(model, 'COL_LABELS') and\
+ field_name in model.COL_LABELS:
+ field = model.COL_LABELS[field_name]
col_names.append(unicode(field).encode(ENCODING))
continue
else:
@@ -1128,7 +1128,7 @@ def get_item(model, func_name, default_name, extra_request_keys=[],
logger.warning(
"**WARN get_item - csv export**: no col name "
"for {}\nadd explicit label to "
- "EXTRA_FULL_FIELDS_LABELS attribute of "
+ "COL_LABELS attribute of "
"{}".format(field_name, model))
continue
col_names.append(