diff options
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 |
commit | da31c986df9f151417348432bb64ee62ad7fa403 (patch) | |
tree | effa65c83a7c98dfaf06ebe3fc13bb00b5a901b1 /archaeological_finds/models_treatments.py | |
parent | 4c9844f9c41e7fccb98228b55b26b15bfb6db364 (diff) | |
download | Ishtar-da31c986df9f151417348432bb64ee62ad7fa403.tar.bz2 Ishtar-da31c986df9f151417348432bb64ee62ad7fa403.zip |
Gin index for data fields
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r-- | archaeological_finds/models_treatments.py | 7 |
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 "" |