summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_finds.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2024-11-19 11:58:15 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2025-02-19 14:45:56 +0100
commite7dfaffc372292d8467da8a8be872e9ac9456618 (patch)
tree0cac7d0f5fcaf03d07062fc35a18a43b0aaa7cae /archaeological_finds/models_finds.py
parent225f4356ca145d7f634aa8050d936de2dbd1cfec (diff)
downloadIshtar-e7dfaffc372292d8467da8a8be872e9ac9456618.tar.bz2
Ishtar-e7dfaffc372292d8467da8a8be872e9ac9456618.zip
✨ base exhibition views
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")