diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-09-12 19:27:31 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-24 12:06:08 +0200 |
commit | 46fde16870a11cd68a3027dd974b4c8b36643d54 (patch) | |
tree | c3d90559afaff5fbd454ce8baf57ee7fd887b6cd /archaeological_warehouse/models.py | |
parent | ef120a060b2eee4d67df7a065c3dd4b67b93f7ba (diff) | |
download | Ishtar-46fde16870a11cd68a3027dd974b4c8b36643d54.tar.bz2 Ishtar-46fde16870a11cd68a3027dd974b4c8b36643d54.zip |
QA packaging
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): """ |