summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-01-10 15:42:40 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-01-10 15:42:40 +0100
commitf538bbeea8d9f7493752d171fe517ec67afd33b2 (patch)
tree23efa1e1d0343d405ff3ce68711166dab2cdda7d /archaeological_finds
parent2521d3aa13c14982c4456ed637c6e55f0077f26a (diff)
downloadIshtar-f538bbeea8d9f7493752d171fe517ec67afd33b2.tar.bz2
Ishtar-f538bbeea8d9f7493752d171fe517ec67afd33b2.zip
Treatment sheet: list related operations
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/models_treatments.py6
-rw-r--r--archaeological_finds/templates/ishtar/sheet_treatment.html3
2 files changed, 8 insertions, 1 deletions
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
diff --git a/archaeological_finds/templates/ishtar/sheet_treatment.html b/archaeological_finds/templates/ishtar/sheet_treatment.html
index 9ec9db754..1b95ec288 100644
--- a/archaeological_finds/templates/ishtar/sheet_treatment.html
+++ b/archaeological_finds/templates/ishtar/sheet_treatment.html
@@ -49,5 +49,8 @@
{% dynamic_table_document finds 'finds_for_treatment' 'upstream_treatment' item.pk 'TABLE_COLS_FOR_OPE' output %}
{% endif %}
+{% trans "Related operations" as related_operations %}
+{% dynamic_table_document related_operations 'operations' 'related_treatment' item.pk 'TABLE_COLS' output %}
+
{% endblock %}