diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-05-23 16:01:37 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-05-23 16:01:37 +0200 |
| commit | 465cd1aad9b091d18f4c9a208d0c091bf14f6dc0 (patch) | |
| tree | 7bd90772d24bce714f539d097a7b0bd552639f2c /archaeological_finds/models_finds.py | |
| parent | b3a500de8a495f0b5e63647887d0113f7c556e2e (diff) | |
| download | Ishtar-465cd1aad9b091d18f4c9a208d0c091bf14f6dc0.tar.bz2 Ishtar-465cd1aad9b091d18f4c9a208d0c091bf14f6dc0.zip | |
Find sheet: display associated treatment files
Diffstat (limited to 'archaeological_finds/models_finds.py')
| -rw-r--r-- | archaeological_finds/models_finds.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index e62c41887..5bffe9851 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -1741,6 +1741,16 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, QRCodeItem, def limited_non_modif_treatments(self): return self.non_modif_treatments(15) + def associated_treatment_files(self): + from archaeological_finds.models_treatments import \ + TreatmentFile + return TreatmentFile.objects.filter( + associated_basket__items__pk=self.pk).order_by( + 'reception_date', 'creation_date', 'end_date') + + def associated_treatment_files_count(self): + return self.associated_treatment_files().count() + @property def weight_string(self): if not self.weight: |
