summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ishtar_common/forms.py5
-rw-r--r--ishtar_common/models_common.py4
2 files changed, 9 insertions, 0 deletions
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py
index b81b42bc6..3dffc77c4 100644
--- a/ishtar_common/forms.py
+++ b/ishtar_common/forms.py
@@ -1029,11 +1029,16 @@ class DocumentItemSelect(ImportSelect):
documents__associated_url__isnull = forms.NullBooleanField(
label=_("Has a web address?")
)
+ documents__source_type = forms.ChoiceField(label=_("Document - Type"), choices=[])
CURRENT_FIELDS = [
"documents__image__isnull",
"documents__associated_file__isnull",
"documents__associated_url__isnull",
+ "documents__source_type",
] + ImportSelect.CURRENT_FIELDS
+ TYPES = [
+ FieldType("documents__source_type", models.SourceType),
+ ] + ImportSelect.TYPES
_explicit_ordering = True
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py
index 38aa6fc51..8a9de207e 100644
--- a/ishtar_common/models_common.py
+++ b/ishtar_common/models_common.py
@@ -1833,6 +1833,10 @@ class DocumentItem:
pgettext_lazy("key for text search", "has-attached-file"),
"documents__associated_file__isnull",
),
+ "documents__source_type": SearchAltName(
+ pgettext_lazy("key for text search", "document-type"),
+ "documents__source_type__label__iexact",
+ ),
}
def documents_list(self) -> list: