diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-02-22 10:25:30 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-02-22 10:25:30 +0100 |
commit | 976d6d79e425d9bc791c461aeeafff465cbf6f6d (patch) | |
tree | 6586c06948e6761eb7d6f9af92391d1aedff6085 | |
parent | f70e1c9707552473d9f33e3d543adf8dae6a3e62 (diff) | |
download | Ishtar-976d6d79e425d9bc791c461aeeafff465cbf6f6d.tar.bz2 Ishtar-976d6d79e425d9bc791c461aeeafff465cbf6f6d.zip |
CSV export: manage json columns
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | ishtar_common/views_item.py | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore index 904b731d7..39efb2876 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,7 @@ *.mo *~ .~* -drassm_app/* -cd17_app/* +*_app ansible/* django-simple-history/* django-formwizard/* @@ -18,6 +17,7 @@ fabfile.py example_project/media example_project/static example_project/celery_app.py +example_project/logs example_project/__init__.py docs/*/build Makefile @@ -44,3 +44,4 @@ scripts .project .pydevproject .settings +src/ diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 796a3eb47..9ec62f511 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -1298,6 +1298,7 @@ def _format_geojson(rows, link_template): def _get_data_from_query(items, query_table_cols, extra_request_keys, point_field=None): + # TODO: manage data json field for query_keys in query_table_cols: if not isinstance(query_keys, (tuple, list)): query_keys = [query_keys] @@ -1386,6 +1387,10 @@ def _get_data_from_query_old( for v in val: v = getattr(v, ky) new_vals += _get_values(request, v) + elif val and isinstance(val, dict): + if ky in val: + val = val[ky] + new_vals += _get_values(request, val) elif val: try: val = getattr(val, ky) |