diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2014-10-15 20:04:39 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2014-10-15 20:04:39 +0200 |
commit | 3705e8647df680f2bc88f365de7bc5381a8da785 (patch) | |
tree | 6c593f0337f0ceb458f616034cbc7feb2a8a5e77 /archaeological_finds | |
parent | 3ce7b9f1a3dec156592740348cd4c42e6c0bd843 (diff) | |
download | Ishtar-3705e8647df680f2bc88f365de7bc5381a8da785.tar.bz2 Ishtar-3705e8647df680f2bc88f365de7bc5381a8da785.zip |
Fix sheet for finds
Diffstat (limited to 'archaeological_finds')
-rw-r--r-- | archaeological_finds/models.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index 2f4c59668..26eb4cbd1 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -142,6 +142,10 @@ class BaseFind(BaseHistorizedItem, OwnPerms): self.context_record.label, lbl) if it]) + @property + def name(self): + return self.label + class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): TABLE_COLS = ['label', 'material_type', 'dating.period', 'base_finds.context_record.parcel.town', @@ -207,6 +211,11 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): def show_url(self): return reverse('show-find', args=[self.pk, '']) + @property + def name(self): + return u" - ".join([base_find.name + for base_find in self.base_finds.all()]) + def get_first_base_find(self): q= self.base_finds if not q.count(): |