From 6a693a41d3dfcb19e073efd4678f02f1be5d244e Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 10 Jan 2017 15:42:40 +0100 Subject: Treatment sheet: list related operations --- archaeological_finds/models_treatments.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'archaeological_finds/models_treatments.py') diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index b8ed79a62..e5f338a48 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -33,7 +33,7 @@ from ishtar_common.models import GeneralType, ImageModel, BaseHistorizedItem, \ ValueGetter, post_save_cache, ShortMenuItem from archaeological_warehouse.models import Warehouse, Container from archaeological_finds.models_finds import Find, FindBasket -from archaeological_operations.models import ClosedItem +from archaeological_operations.models import ClosedItem, Operation class TreatmentType(GeneralType): @@ -179,6 +179,10 @@ class Treatment(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): owns, key=lambda x: x.cached_label if hasattr(x, 'cached_label') else unicode(x)) + def get_query_operations(self): + return Operation.objects.filter( + context_record__base_finds__find__downstream_treatment=self) + def _generate_cached_label(self): items = [unicode(getattr(self, k)) for k in ['year', 'index', 'other_reference', 'label'] if -- cgit v1.2.3