diff options
Diffstat (limited to 'archaeological_finds/models_finds.py')
| -rw-r--r-- | archaeological_finds/models_finds.py | 18 | 
1 files changed, 15 insertions, 3 deletions
| diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index e58d14f7e..8052601bf 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -231,14 +231,17 @@ class BaseFind(BulkUpdatedItem, BaseHistorizedItem, OwnPerms):      line = models.LineStringField(_(u"Line"), blank=True, null=True)      polygon = models.PolygonField(_(u"Polygon"), blank=True, null=True)      cache_short_id = models.TextField( -        _(u"Short ID"), blank=True, null=True, +        _(u"Short ID"), blank=True, null=True, db_index=True,          help_text=_(u"Cached value - do not edit"))      cache_complete_id = models.TextField( -        _(u"Complete ID"), blank=True, null=True, +        _(u"Complete ID"), blank=True, null=True, db_index=True,          help_text=_(u"Cached value - do not edit"))      history = HistoricalRecords()      RELATED_POST_PROCESS = ['find']      CACHED_LABELS = ['cache_short_id', 'cache_complete_id'] +    PARENT_SEARCH_VECTORS = ['context_record'] +    BASE_SEARCH_VECTORS = ["label", "description", "comment", "cache_short_id", +                           "cache_complete_id"]      class Meta:          verbose_name = _(u"Base find") @@ -748,9 +751,18 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, ImageModel,      appraisal_date = models.DateField(_(u"Appraisal date"), blank=True,                                        null=True) -    cached_label = models.TextField(_(u"Cached name"), null=True, blank=True) +    cached_label = models.TextField(_(u"Cached name"), null=True, blank=True, +                                    db_index=True)      history = HistoricalRecords()      BASKET_MODEL = FindBasket +    PARENT_SEARCH_VECTORS = ['base_finds'] +    BASE_SEARCH_VECTORS = [ +        "cached_label", "label", "description", "container__location__name", +        "container__reference", "mark", "comment", "dating_comment", +        "previous_id"] +    M2M_SEARCH_VECTORS = [ +        "datings__period__label", "object_types__label", "integrities__label", +        "remarkabilities__label", "material_types__label"]      class Meta:          verbose_name = _(u"Find") | 
