diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-18 18:40:03 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-18 18:43:35 +0200 |
commit | c10cdd8220589a4ce5bed01bc08cd11c92fdcdb5 (patch) | |
tree | 5fc13186c4ec5281337c13c85f6eaf1c82c7b047 | |
parent | 9dc5235b1d373d8a61cc9806de76ab834a1fd90b (diff) | |
download | Ishtar-c10cdd8220589a4ce5bed01bc08cd11c92fdcdb5.tar.bz2 Ishtar-c10cdd8220589a4ce5bed01bc08cd11c92fdcdb5.zip |
✨ archaeological files search: add new fields
-rw-r--r-- | archaeological_files/forms.py | 4 | ||||
-rw-r--r-- | archaeological_files/models.py | 16 | ||||
-rw-r--r-- | ishtar_common/views_item.py | 2 |
3 files changed, 18 insertions, 4 deletions
diff --git a/archaeological_files/forms.py b/archaeological_files/forms.py index e8dd4c025..82383a71d 100644 --- a/archaeological_files/forms.py +++ b/archaeological_files/forms.py @@ -100,7 +100,9 @@ class FileSelect(DocumentItemSelect): name = forms.CharField(label=_("File name"), max_length=200) file_type = forms.ChoiceField(label=_("File type"), choices=[]) end_date = forms.NullBooleanField(label=_("Is active?")) + development_type = forms.ChoiceField(label=_("Development type"), choices=[]) saisine_type = forms.ChoiceField(label=_("Saisine type"), choices=[]) + monitoring_justification = forms.ChoiceField(label=_("Monitoring justification"), choices=[]) permit_type = forms.ChoiceField(label=_("Permit type"), choices=[]) permit_reference = forms.CharField(max_length=200, label=_("Permit/order reference")) comment = forms.CharField(label=_("Comment"), max_length=500) @@ -154,6 +156,8 @@ class FileSelect(DocumentItemSelect): TYPES = [ FieldType("saisine_type", models.SaisineType), + FieldType("development_type", models.DevelopmentType), + FieldType("monitoring_justification", models.MonitoringJustificationType), FieldType("permit_type", models.PermitType), FieldType("file_type", models.FileType), ] diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 74ce3a0d6..b6f1ee37c 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -439,8 +439,8 @@ class File( STATISTIC_SUM_VARIABLE = OrderedDict( ( ("pk", (_("Number"), 1)), - ("total_surface", (_("Total surface (km2)"), 0.000001)), - ("total_developed_surface", (_("Total developed surface (km2)"), 0.000001)), + ("total_surface", (_("Total surface (km²)"), 0.000001)), + ("total_developed_surface", (_("Total developed surface (km²)"), 0.000001)), ) ) GET_VALUES_M2M = [ @@ -543,6 +543,14 @@ class File( "saisine_type__label__iexact", related_name="saisine_type" ), + "development_type": SearchAltName( + pgettext_lazy("key for text search", "development-type"), + "development_type__label__iexact", + ), + "monitoring_justification": SearchAltName( + pgettext_lazy("key for text search", "monitoring-justification"), + "monitoring_justification__label__iexact", + ), "permit_type": SearchAltName( pgettext_lazy("key for text search", "permit-type"), "permit_type__label__iexact", @@ -689,9 +697,9 @@ class File( instruction_deadline = models.DateField( _("Instruction deadline"), blank=True, null=True ) - total_surface = models.FloatField(_("Total surface (m2)"), blank=True, null=True) + total_surface = models.FloatField(_("Total surface (m²)"), blank=True, null=True) total_developed_surface = models.FloatField( - _("Total developed surface (m2)"), blank=True, null=True + _("Total developed surface (m²)"), blank=True, null=True ) locality = models.CharField(_("Locality"), max_length=100, null=True, blank=True) address = models.TextField(_("Main address"), blank=True, default="") diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 728822f0c..052723955 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -118,6 +118,8 @@ LIST_FIELDS = { # key: hierarchic depth "textures": HIERARCHIC_LEVELS, "inclusions": HIERARCHIC_LEVELS, "colors": HIERARCHIC_LEVELS, + "development_type": HIERARCHIC_LEVELS, + "monitoring_justification": HIERARCHIC_LEVELS, "museum_inventory_marking_presence": 0, "museum_marking_type": 0, "museum_collection": 0, |