From ac268adb38f984041bfab70027a563b5d4c68ad2 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 17 Nov 2015 21:52:49 +0100 Subject: Finds: fix full id --- archaeological_finds/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'archaeological_finds') diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index 8505e81a0..479880887 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -138,8 +138,12 @@ class BaseFind(BaseHistorizedItem, OwnPerms): ope = self.context_record.operation c_id = [unicode(ope.code_patriarche) if ope.code_patriarche else (unicode(ope.year) + "-" + unicode(ope.operation_code))] - # c_id.append(find and find.material_type.code or '') - c_id.append('') + materials = set() + for find in self.find.filter(downstream_treatment__isnull=True): + for mat in find.material_types.all(): + if mat.code: + materials.add(mat.code) + c_id.append(u'-'.join(sorted(list(materials)))) c_id.append(self.context_record.label) c_id.append(unicode(self.index)) return settings.JOINT.join(c_id) -- cgit v1.2.3