diff options
Diffstat (limited to 'archaeological_finds/models.py')
-rw-r--r-- | archaeological_finds/models.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index bd446235b..068debdb0 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -372,6 +372,18 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): return u" - ".join([base_find.name for base_find in self.base_finds.all()]) + @property + def full_label(self): + lbl = u" - ".join([ + getattr(self, attr) + for attr in ('label', 'administrative_index') + if getattr(self, attr)]) + base = u" - ".join([base_find.complete_id() + for base_find in self.base_finds.all()]) + if base: + lbl += ' ({})'.format(base) + return lbl + def get_first_base_find(self): q = self.base_finds if not q.count(): |