diff options
Diffstat (limited to 'archaeological_finds/models.py')
| -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) | 
