summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_finds.py
diff options
context:
space:
mode:
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
commitc3df7b713610352a3b41fa1a8e2fcef0abec572b (patch)
tree7bd90772d24bce714f539d097a7b0bd552639f2c /archaeological_finds/models_finds.py
parent458ef5c3e9f062c6dab5de578a0d45ef3a4bc3e0 (diff)
downloadIshtar-c3df7b713610352a3b41fa1a8e2fcef0abec572b.tar.bz2
Ishtar-c3df7b713610352a3b41fa1a8e2fcef0abec572b.zip
Find sheet: display associated treatment files
Diffstat (limited to 'archaeological_finds/models_finds.py')
-rw-r--r--archaeological_finds/models_finds.py10
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: