summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_treatments.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-12-16 10:52:15 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-12-16 10:52:15 +0100
commit4364e8e447f511b574c30c342082b05918496bca (patch)
treeeffa65c83a7c98dfaf06ebe3fc13bb00b5a901b1 /archaeological_finds/models_treatments.py
parent46fcb2d2354d71b53fd0f72af62b224e50370211 (diff)
downloadIshtar-4364e8e447f511b574c30c342082b05918496bca.tar.bz2
Ishtar-4364e8e447f511b574c30c342082b05918496bca.zip
Gin index for data fields
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r--archaeological_finds/models_treatments.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py
index f09343c46..1f2ad1c0f 100644
--- a/archaeological_finds/models_treatments.py
+++ b/archaeological_finds/models_treatments.py
@@ -21,6 +21,7 @@ import datetime
from django.conf import settings
from django.contrib.gis.db import models
+from django.contrib.postgres.indexes import GinIndex
from django.core.urlresolvers import reverse
from django.db.models import Max, Q
from django.db.models.signals import post_save, post_delete, pre_delete, \
@@ -229,6 +230,9 @@ class Treatment(DashboardFormItem, ValueGetter, DocumentItem,
("delete_own_treatment", u"Can delete own Treatment"),
)
ordering = ("-year", "-index", "-start_date")
+ indexes = [
+ GinIndex(fields=['data']),
+ ]
def __str__(self):
return self.cached_label or ""
@@ -1030,6 +1034,9 @@ class TreatmentFile(DashboardFormItem, ClosedItem, DocumentItem,
u"Can delete own Treatment request"),
)
ordering = ('cached_label',)
+ indexes = [
+ GinIndex(fields=['data']),
+ ]
def __str__(self):
return self.cached_label or ""