summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-06-08 17:10:05 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-06-08 17:10:05 +0200
commit7fe69ae8c625ee4d647284c008900b9485b9c8c8 (patch)
treedaf63bf501a2c34533965a2ab7cd9c8885067b92 /ishtar_common
parente553dcaf59aedf91aeb5d0e830ff171dce36d353 (diff)
downloadIshtar-7fe69ae8c625ee4d647284c008900b9485b9c8c8.tar.bz2
Ishtar-7fe69ae8c625ee4d647284c008900b9485b9c8c8.zip
✨ Search criteria - geo - "Z lower than", "Z higher than"
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/forms.py4
-rw-r--r--ishtar_common/models_common.py8
2 files changed, 12 insertions, 0 deletions
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py
index ad2548aa1..5a2e14b02 100644
--- a/ishtar_common/forms.py
+++ b/ishtar_common/forms.py
@@ -1312,12 +1312,16 @@ class GeoItemSelect(DocumentItemSelect): # all geo item can have documents
geodata__data_type = forms.ChoiceField(label=_("Geo - Data type"), choices=[])
geodata__origin = forms.ChoiceField(label=_("Geo - Origin"), choices=[])
geodata__provider = forms.ChoiceField(label=_("Geo - Provider"), choices=[])
+ geodata__z__gt = forms.FloatField(label=_("Geo - Z - higher than"))
+ geodata__z__lt = forms.FloatField(label=_("Geo - Z - lower than"))
geodata__comment = forms.CharField(label=_("Geo - Comment"), max_length=500)
CURRENT_FIELDS = [
"geodata__name",
"geodata__data_type",
"geodata__origin",
"geodata__provider",
+ "geodata__z__gt",
+ "geodata__z__lt",
"geodata__comment",
] + DocumentItemSelect.CURRENT_FIELDS
_explicit_ordering = True
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py
index a6f5d1197..78a7cc037 100644
--- a/ishtar_common/models_common.py
+++ b/ishtar_common/models_common.py
@@ -3039,6 +3039,14 @@ class GeographicItem(models.Model):
"geodata__provider": SearchAltName(
pgettext_lazy("key for text search", "geo-provider"), "geodata__provider__label__iexact"
),
+ "geodata__z__gt": SearchAltName(
+ pgettext_lazy("key for text search", "z-higher"),
+ "geodata__cached_z__gte"
+ ),
+ "geodata__z__lt": SearchAltName(
+ pgettext_lazy("key for text search", "z-lower"),
+ "geodata__cached_z__lte"
+ ),
"geodata__comment": SearchAltName(
pgettext_lazy("key for text search", "geo-comment"), "geodata__comment__iexact"
),