diff options
Diffstat (limited to 'archaeological_finds/models_finds.py')
-rw-r--r-- | archaeological_finds/models_finds.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index c5bca5fb6..d9ebe9dfe 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -23,6 +23,7 @@ import uuid 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 import connection from django.db.models import Max, Q, F @@ -330,6 +331,9 @@ class BaseFind(BulkUpdatedItem, BaseHistorizedItem, GeoItem, OwnPerms, ("change_own_basefind", u"Can change own Base find"), ("delete_own_basefind", u"Can delete own Base find"), ) + indexes = [ + GinIndex(fields=['data']), + ] def __str__(self): return self.label @@ -1652,6 +1656,9 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem, ("delete_own_find", u"Can delete own Find"), ) ordering = ('cached_label',) + indexes = [ + GinIndex(fields=['data']), + ] def natural_key(self): return (self.uuid, ) @@ -2532,6 +2539,9 @@ class Property(LightHistorizedItem): class Meta: verbose_name = _(u"Property") verbose_name_plural = _(u"Properties") + indexes = [ + GinIndex(fields=['data']), + ] def __str__(self): return str(self.person) + settings.JOINT + str(self.find) |