summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-01-19 15:35:43 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-01-19 15:35:43 +0100
commitcc1eb217bd22da8fcad3bc0fd785a6889e0be157 (patch)
treeb3aa5c0104016c4fb84f656f051ce0206e61a5f1 /archaeological_finds
parent1aa3218151854fcbbdc0be627bc2bd951aa567ba (diff)
downloadIshtar-cc1eb217bd22da8fcad3bc0fd785a6889e0be157.tar.bz2
Ishtar-cc1eb217bd22da8fcad3bc0fd785a6889e0be157.zip
Search vectors for authors and sources
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/migrations/0015_auto_20180119_1516.py31
-rw-r--r--archaeological_finds/models_finds.py1
-rw-r--r--archaeological_finds/models_treatments.py2
3 files changed, 34 insertions, 0 deletions
diff --git a/archaeological_finds/migrations/0015_auto_20180119_1516.py b/archaeological_finds/migrations/0015_auto_20180119_1516.py
new file mode 100644
index 000000000..7d2067771
--- /dev/null
+++ b/archaeological_finds/migrations/0015_auto_20180119_1516.py
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11 on 2018-01-19 15:16
+from __future__ import unicode_literals
+
+import django.contrib.postgres.search
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('archaeological_finds', '0014_auto_20171110_1717'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='findsource',
+ name='search_vector',
+ field=django.contrib.postgres.search.SearchVectorField(blank=True, help_text='Auto filled at save', null=True, verbose_name='Search vector'),
+ ),
+ migrations.AddField(
+ model_name='treatmentfilesource',
+ name='search_vector',
+ field=django.contrib.postgres.search.SearchVectorField(blank=True, help_text='Auto filled at save', null=True, verbose_name='Search vector'),
+ ),
+ migrations.AddField(
+ model_name='treatmentsource',
+ name='search_vector',
+ field=django.contrib.postgres.search.SearchVectorField(blank=True, help_text='Auto filled at save', null=True, verbose_name='Search vector'),
+ ),
+ ]
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 2b782c614..e1c866f9d 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -1361,6 +1361,7 @@ class FindSource(Source):
'find__datings__period': 'find__datings__period__pk',
'find__description': 'find__description__icontains',
}
+ PARENT_SEARCH_VECTORS = Source.PARENT_SEARCH_VECTORS + ['find']
class Meta:
verbose_name = _(u"Find documentation")
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py
index 6c173959a..38d4f55b3 100644
--- a/archaeological_finds/models_treatments.py
+++ b/archaeological_finds/models_treatments.py
@@ -594,6 +594,7 @@ class TreatmentSource(Source):
TABLE_COLS = ['treatment__cached_label'] + Source.TABLE_COLS
COL_LABELS = {'treatment__cached_label': _(u"Treatment")}
SHOW_URL = 'show-treatmentsource'
+ PARENT_SEARCH_VECTORS = Source.PARENT_SEARCH_VECTORS + ['treatment']
class Meta:
verbose_name = _(u"Treatment documentation")
@@ -628,6 +629,7 @@ class TreatmentFileSource(Source):
TABLE_COLS = ['treatment_file__cached_label'] + Source.TABLE_COLS
COL_LABELS = {'treatment_file__cached_label': _(u"Treatment file")}
SHOW_URL = 'show-treatmentfilesource'
+ PARENT_SEARCH_VECTORS = Source.PARENT_SEARCH_VECTORS + ['treatment_file']
class Meta:
verbose_name = _(u"Treatment request documentation")