diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-04-10 16:34:33 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:20 +0100 | 
| commit | 69cf0a7de4b4d842c814e83f28f7d45aec69929c (patch) | |
| tree | 1a7567e73ab784209a74ede0481bfc2e21079748 /archaeological_warehouse/models.py | |
| parent | da80b35938a3bd8690c60959f0d39873d1d2cfd1 (diff) | |
| download | Ishtar-69cf0a7de4b4d842c814e83f28f7d45aec69929c.tar.bz2 Ishtar-69cf0a7de4b4d842c814e83f28f7d45aec69929c.zip | |
Fix merge candidate for containers
Diffstat (limited to 'archaeological_warehouse/models.py')
| -rw-r--r-- | archaeological_warehouse/models.py | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 53e50976d..8d2a3fb71 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -482,6 +482,7 @@ class Container(DocumentItem, Merge, LightHistorizedItem, QRCodeItem, GeoItem,          SearchVectorConfig("division__reference"),          SearchVectorConfig("division__division__division__label"),      ] +    PARENT_SEARCH_VECTORS = ["parent"]      # search parameters      EXTRA_REQUEST_KEYS = { @@ -704,6 +705,7 @@ class Container(DocumentItem, Merge, LightHistorizedItem, QRCodeItem, GeoItem,          verbose_name=_("Main image"), blank=True, null=True)      DISABLE_POLYGONS = False +    MERGE_ATTRIBUTE = "get_cached_division"      class Meta:          verbose_name = _("Container") @@ -751,6 +753,10 @@ class Container(DocumentItem, Merge, LightHistorizedItem, QRCodeItem, GeoItem,          cached_label = " - ".join(items)          return cached_label +    @property +    def get_cached_division(self): +        return self._generate_cached_division() +      def _generate_cached_division(self):          parents = []          parent = self.parent | 
