summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_treatments.py
diff options
context:
space:
mode:
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 ""