From e943d1982fa451fc886419040aba280d6960b117 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 23 Jan 2019 10:39:41 +0100 Subject: Map: manage get item request --- archaeological_operations/forms.py | 1 - ishtar_common/views_item.py | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index bae40492f..a28d3565b 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -1199,7 +1199,6 @@ class ArchaeologicalSiteForm(ManageOldType): spatial_reference_system = forms.ChoiceField( label=_(u"Spatial Reference System"), required=False, choices=[]) - PROFILE_FILTER = { 'mapping': [ 'x', 'get_first_base_find__y', diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 2577efd12..b8307c457 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -1040,7 +1040,7 @@ def get_item(model, func_name, default_name, extra_request_keys=None, if data_type == "json": EMPTY = '[]' - if data_type not in ('json', 'csv', 'json-image'): + if data_type not in ('json', 'csv', 'json-image', 'json-map'): return HttpResponse(EMPTY, content_type='text/plain') model_to_check = model @@ -1396,6 +1396,19 @@ def get_item(model, func_name, default_name, extra_request_keys=None, query_table_cols.append('main_image__thumbnail') table_cols.append('main_image__image') table_cols.append('main_image__thumbnail') + elif data_type == 'json-map': + if model.SLUG == "warehouse": + query_table_cols.append('name') + table_cols.append('name') + else: + query_table_cols.append('cached_label') + table_cols.append('cached_label') + if model.SLUG == "find": + query_table_cols.append('base_finds__point_2d') + table_cols.append('base_finds__point_2d') + else: + query_table_cols.append('point_2d') + table_cols.append('point_2d') # manage sort tables manual_sort_key = None -- cgit v1.2.3