summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_finds.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/models_finds.py')
-rw-r--r--archaeological_finds/models_finds.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 4c410f668..68d49dfd6 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -955,6 +955,24 @@ class FindBasket(Basket, MainItem, ValueGetter):
)
ADMIN_SECTION = _("Finds")
+ @property
+ def treatments(self):
+ Treatment = apps.get_model("archaeological_finds", "Treatment")
+ return Treatment.objects.filter(associated_basket_id=self.pk)
+
+ @property
+ def treatments_list(self):
+ return list(self.treatments.all())
+
+ @property
+ def treatment_files(self):
+ TreatmentFile = apps.get_model("archaeological_finds", "TreatmentFile")
+ return TreatmentFile.objects.filter(associated_basket_id=self.pk)
+
+ @property
+ def treatment_files_list(self):
+ return list(self.treatment_files.all())
+
def get_values(self, prefix="", no_values=False, filtr=None, **kwargs):
base_exclude = kwargs["exclude"][:] if "exclude" in kwargs else []
base_exclude.append(prefix + "items")