diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-10-12 13:17:17 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-10-12 13:17:17 +0200 |
| commit | d658fbb5b55c6ce318383b535732763e810b6537 (patch) | |
| tree | 7d3f57ec13a117bbbaa8cd9e5117b2478456cd0f /archaeological_finds/models_finds.py | |
| parent | 0c75a8c1300338ce0a03d3a1bb57959f48eaaf1a (diff) | |
| download | Ishtar-d658fbb5b55c6ce318383b535732763e810b6537.tar.bz2 Ishtar-d658fbb5b55c6ce318383b535732763e810b6537.zip | |
Performance: add indexes for cached labels
Diffstat (limited to 'archaeological_finds/models_finds.py')
| -rw-r--r-- | archaeological_finds/models_finds.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index e58d14f7e..966dd1065 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -231,10 +231,10 @@ 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'] @@ -748,7 +748,8 @@ 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 |
