diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-11-17 21:52:49 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-11-17 21:52:49 +0100 |
commit | ae9a3987974418a021fef977eec7a513a1d1e4cf (patch) | |
tree | 9764ee557b1ebbba5b07faec334aa661f0e7cf23 | |
parent | c463033366cc01d5355d169972c0b5a398ba15d9 (diff) | |
download | Ishtar-ae9a3987974418a021fef977eec7a513a1d1e4cf.tar.bz2 Ishtar-ae9a3987974418a021fef977eec7a513a1d1e4cf.zip |
Finds: fix full id
-rw-r--r-- | archaeological_finds/models.py | 8 |
1 files changed, 6 insertions, 2 deletions
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) |