From 3705e8647df680f2bc88f365de7bc5381a8da785 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 15 Oct 2014 20:04:39 +0200 Subject: Fix sheet for finds --- archaeological_finds/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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(): -- cgit v1.2.3