summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_finds/models_treatments.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py
index 7563c487f..b903a8997 100644
--- a/archaeological_finds/models_treatments.py
+++ b/archaeological_finds/models_treatments.py
@@ -142,10 +142,11 @@ class Treatment(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
)
def __unicode__(self):
- lbl = unicode(self.treatment_types_lbl())
- if self.person:
- lbl += u" %s %s" % (_(u"by"), unicode(self.person))
- return lbl
+ if self.cached_label:
+ return self.cached_label
+ self.skip_history_when_saving = True
+ self.save()
+ return self.cached_label
@property
def short_class_name(self):
@@ -180,7 +181,7 @@ class Treatment(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
items = [unicode(getattr(self, k))
for k in ['year', 'index', 'other_reference', 'label'] if
getattr(self, k)]
- return settings.JOINT.join(items)
+ return u'{} | {}'.format(u"-".join(items), self.treatment_types_lbl())
def treatment_types_lbl(self):
"""