diff options
Diffstat (limited to 'archaeological_warehouse/models.py')
| -rw-r--r-- | archaeological_warehouse/models.py | 10 | 
1 files changed, 6 insertions, 4 deletions
| diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index b1b6467ae..e46aae13b 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -334,7 +334,7 @@ class Container(LightHistorizedItem, ImageModel):          'cached_division': _(u"Precise localisation"),          'container_type__label': _(u"Type")      } -    CACHED_LABELS = ['cached_label', 'cached_location', 'cached_division'] +    CACHED_LABELS = ['cached_division', 'cached_label', 'cached_location', ]      # alternative names of fields for searches      ALT_NAMES = { @@ -399,8 +399,7 @@ class Container(LightHistorizedItem, ImageModel):          )      def __unicode__(self): -        lbl = u"{} ({})".format(self.reference, self.container_type) -        return lbl +        return self.cached_label      def natural_key(self):          return (self.external_id, ) @@ -444,7 +443,10 @@ class Container(LightHistorizedItem, ImageModel):      @property      def precise_location(self): -        return self.location.name + u" - " + (self.cached_division or u"") +        location = self.location.name +        if self.cached_division: +            location += self.cached_division +        return location      def get_localisations(self):          """ | 
