diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-11-02 16:03:26 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:23:19 +0100 |
commit | 49baa55756d8f6427f382c327ec7fe233b2c05d3 (patch) | |
tree | 5888b277c026e0c6e9209472f016055ba73d77c4 /ishtar_common/forms.py | |
parent | 4ed26f54bde75a1a392b717d5306a3f59802206b (diff) | |
download | Ishtar-49baa55756d8f6427f382c327ec7fe233b2c05d3.tar.bz2 Ishtar-49baa55756d8f6427f382c327ec7fe233b2c05d3.zip |
Geodata - search: add search fields on related items searches
Diffstat (limited to 'ishtar_common/forms.py')
-rw-r--r-- | ishtar_common/forms.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index c5058ab0d..d15352e64 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -1292,3 +1292,24 @@ class DocumentGenerationForm(forms.Form): except models.DocumentTemplate.DoesNotExist: return return template.publish(c_object) + + +class GeoItemSelect(DocumentItemSelect): # all geo item can have documents + geodata__name = forms.CharField(label=_("Geo - Name"), max_length=300) + 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__comment = forms.CharField(label=_("Geo - Comment"), max_length=500) + CURRENT_FIELDS = [ + "geodata__name", + "geodata__data_type", + "geodata__origin", + "geodata__provider", + "geodata__comment", + ] + DocumentItemSelect.CURRENT_FIELDS + _explicit_ordering = True + TYPES = [ + FieldType("geodata__data_type", models.GeoDataType), + FieldType("geodata__origin", models.GeoOriginType), + FieldType("geodata__provider", models.GeoProviderType), + ] + DocumentItemSelect.TYPES |