summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r--archaeological_warehouse/models.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py
index 6e2df520e..cec8667cd 100644
--- a/archaeological_warehouse/models.py
+++ b/archaeological_warehouse/models.py
@@ -32,7 +32,7 @@ from ishtar_common.models import Document, GeneralType, get_external_id, \
LightHistorizedItem, OwnPerms, Address, Person, post_save_cache, \
DashboardFormItem, ExternalIdManager, ShortMenuItem, \
document_attached_changed, SearchAltName, DynamicRequest, GeoItem, \
- QRCodeItem
+ QRCodeItem, SearchVectorConfig
from ishtar_common.utils import cached_label_changed, post_save_geo
@@ -54,8 +54,13 @@ class Warehouse(Address, GeoItem, QRCodeItem, DashboardFormItem, OwnPerms,
MODEL = "warehouse"
SHOW_URL = 'show-warehouse'
TABLE_COLS = ['name', 'warehouse_type']
- BASE_SEARCH_VECTORS = ['name', 'warehouse_type__label', "external_id",
- "town", "comment"]
+ BASE_SEARCH_VECTORS = [
+ SearchVectorConfig("name"),
+ SearchVectorConfig("warehouse_type__label"),
+ SearchVectorConfig("external_id"),
+ SearchVectorConfig("town"),
+ SearchVectorConfig("comment", "local"),
+ ]
EXTRA_REQUEST_KEYS = {
# used by dynamic_table_documents
@@ -333,10 +338,17 @@ class Container(LightHistorizedItem, QRCodeItem, GeoItem, OwnPerms):
TABLE_COLS = ['reference', 'container_type__label', 'cached_location',
'cached_division', 'old_reference']
IMAGE_PREFIX = 'containers/'
- BASE_SEARCH_VECTORS = ['reference', 'container_type__label',
- 'cached_location', 'old_reference', 'comment']
- M2M_SEARCH_VECTORS = ['division__reference',
- 'division__division__division__label']
+ BASE_SEARCH_VECTORS = [
+ SearchVectorConfig("reference"),
+ SearchVectorConfig("container_type__label"),
+ SearchVectorConfig("cached_location"),
+ SearchVectorConfig("old_reference"),
+ SearchVectorConfig("comment", "local"),
+ ]
+ M2M_SEARCH_VECTORS = [
+ SearchVectorConfig("division__reference"),
+ SearchVectorConfig("division__division__division__label"),
+ ]
# search parameters
EXTRA_REQUEST_KEYS = {