diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-05-19 01:38:17 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-05-19 01:38:17 +0200 |
commit | 0e93e02daa16c704e43ec19d5b4028e7a93968a5 (patch) | |
tree | 95813f81c745f30839c4febba1990a85d7ab6d08 /archaeological_finds/models.py | |
parent | 95ac7dd7492eb0d469f84deacfa88e84d442c203 (diff) | |
download | Ishtar-0e93e02daa16c704e43ec19d5b4028e7a93968a5.tar.bz2 Ishtar-0e93e02daa16c704e43ec19d5b4028e7a93968a5.zip |
Manage basket content
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(): |