summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES-DEV.md12
-rw-r--r--ishtar_common/models_common.py14
-rw-r--r--ishtar_common/wizards.py7
3 files changed, 25 insertions, 8 deletions
diff --git a/CHANGES-DEV.md b/CHANGES-DEV.md
index 2607374c9..5d983f6c6 100644
--- a/CHANGES-DEV.md
+++ b/CHANGES-DEV.md
@@ -2,9 +2,17 @@ Ishtar changelog
================
### Features ###
-- Context record: bulk update relation - type
-- Context record: change field order
- JSON types: multi valued choices
+- Forms:
+ - context record: change field order
+- Admin: available/unavailable action
+- Bulk action:
+ - site: remains, cultural attributions, collaborators,
+ - operation: collaborators
+ - find: conservation commentary
+ - context record: town, relation - type
+- Search:
+ - document: operation year, operation type
### Bugs ###
- Search: fix url for person and organization
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py
index dc078000e..372890f22 100644
--- a/ishtar_common/models_common.py
+++ b/ishtar_common/models_common.py
@@ -970,11 +970,15 @@ class FullSearch(models.Model):
# only index year
self._update_search_number_field(search_vectors, data.year)
continue
- for lang in ("simple", settings.ISHTAR_SEARCH_LANGUAGE):
- with connection.cursor() as cursor:
- cursor.execute("SELECT to_tsvector(%s, %s)", [lang, data])
- row = cursor.fetchone()
- search_vectors.append(row[0])
+ datas = [data]
+ if json_field.value_type == "MC":
+ datas = data
+ for d in datas:
+ for lang in ("simple", settings.ISHTAR_SEARCH_LANGUAGE):
+ with connection.cursor() as cursor:
+ cursor.execute("SELECT to_tsvector(%s, %s)", [lang, d])
+ row = cursor.fetchone()
+ search_vectors.append(row[0])
new_search_vector = merge_tsvectors(search_vectors)
changed = old_search != new_search_vector
self.search_vector = new_search_vector
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py
index 2b0a47a72..47839b58e 100644
--- a/ishtar_common/wizards.py
+++ b/ishtar_common/wizards.py
@@ -463,7 +463,6 @@ class Wizard(IshtarWizard):
else:
value = _("No")
elif key in associated_models:
- values = []
if type(value) in (tuple, list):
values = value
elif "," in str(value):
@@ -479,6 +478,12 @@ class Wizard(IshtarWizard):
value = str(item)
rendered_values.append(value)
value = " ; ".join(rendered_values)
+ if key.startswith("data__"):
+ if isinstance(value, list):
+ value = ", ".join(value)
+ if value.startswith("[") and value.endswith("]"):
+ value = " ; ".join(
+ [v.strip()[1:-1] for v in value[1:-1].split(",")])
current_form_data.append((lbl, value, ""))
if is_formset: