summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ishtar_common/forms_common.py7
-rw-r--r--ishtar_common/models.py4
2 files changed, 10 insertions, 1 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py
index 935436eaa..9c9611778 100644
--- a/ishtar_common/forms_common.py
+++ b/ishtar_common/forms_common.py
@@ -71,7 +71,7 @@ from .forms import (
from ishtar_common.data_importer import ImporterError
from ishtar_common.utils import is_downloadable, clean_session_cache, max_size_help
-from archaeological_operations.models import Operation
+from archaeological_operations.models import Operation, OperationType
from archaeological_context_records.models import ContextRecord
from archaeological_finds.models import Find, FindBasket
from archaeological_warehouse.models import Container
@@ -1930,6 +1930,10 @@ class DocumentSelect(HistorySelect):
),
validators=[models.valid_id(Operation)],
)
+ operations__operation_type = forms.ChoiceField(
+ label=_("Operation type"),
+ choices=[]
+ )
context_record = forms.IntegerField(
label=_("Context record"),
required=False,
@@ -1989,6 +1993,7 @@ class DocumentSelect(HistorySelect):
FieldType("tag", models.DocumentTag),
FieldType("language", models.Language),
FieldType("licenses", models.LicenseType),
+ FieldType("operations__operation_type", models.OperationType),
]
PROFILE_FILTER = {
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 0e3051e28..43dc5ed51 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -3685,6 +3685,10 @@ class Document(
pgettext_lazy("key for text search", "operation"),
"operations__cached_label__iexact",
),
+ "operations__operation_type": SearchAltName(
+ pgettext_lazy("key for text search", "operation-type"),
+ "operations__operation_type__label__iexact",
+ ),
"context_record": SearchAltName(
pgettext_lazy("key for text search", "context-record"),
"context_records__cached_label__iexact",