summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2025-02-06 17:56:14 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2025-02-19 14:45:57 +0100
commit1d049ac1cac1aa74610e298f5d074527dabdbb5c (patch)
tree445d97245a46afef7ac79b7782318ed50aa46976 /archaeological_warehouse/forms.py
parent32b4271ea9e7540a7613429563fffde20e57690d (diff)
downloadIshtar-1d049ac1cac1aa74610e298f5d074527dabdbb5c.tar.bz2
Ishtar-1d049ac1cac1aa74610e298f5d074527dabdbb5c.zip
✨ Town, area searches for person, organisations, archaeological files, context records, warehouses and containers (refs #6095)
Diffstat (limited to 'archaeological_warehouse/forms.py')
-rw-r--r--archaeological_warehouse/forms.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py
index edc4a3b74..1e1979cac 100644
--- a/archaeological_warehouse/forms.py
+++ b/archaeological_warehouse/forms.py
@@ -30,11 +30,12 @@ from django.forms.formsets import formset_factory
from ishtar_common.utils import ugettext_lazy as _
from ishtar_common.models import (
+ Area,
+ Organization,
Person,
- valid_id,
- Town,
SpatialReferenceSystem,
- Organization,
+ Town,
+ valid_id,
valid_ids,
)
from archaeological_operations.models import ArchaeologicalSite
@@ -148,11 +149,11 @@ class WarehouseSelect(CustomForm, TableSelect):
name = forms.CharField(label=_("Name"))
warehouse_type = forms.ChoiceField(label=_("Warehouse type"), choices=[])
town = get_town_field(label=_("Town"))
-
- def __init__(self, *args, **kwargs):
- super(WarehouseSelect, self).__init__(*args, **kwargs)
- self.fields["warehouse_type"].choices = models.WarehouseType.get_types()
- self.fields["warehouse_type"].help_text = models.WarehouseType.get_help()
+ area = forms.ChoiceField(label=_("Area"), choices=[])
+ TYPES = [
+ FieldType('area', Area),
+ FieldType("warehouse_type", models.WarehouseType),
+ ]
class WarehouseFormSelection(LockForm, CustomFormSearch):
@@ -514,6 +515,8 @@ class ContainerSelect(DocumentItemSelect):
)
location_name = get_warehouse_field(label=_("Warehouse"))
responsibility_name = get_warehouse_field(label=_("Warehouse (responsibility)"))
+ town = get_town_field(label=_("Warehouse - Town"))
+ area = forms.ChoiceField(label=_("Warehouse - Area"), choices=[])
container_type = forms.ChoiceField(label=_("Container type"), choices=[])
reference = forms.CharField(label=_("Ref."))
code = forms.CharField(label=_("Code"))
@@ -600,6 +603,7 @@ class ContainerSelect(DocumentItemSelect):
treatment_emergency = forms.ChoiceField(choices=[], label=_("Treatment emergency"))
TYPES = [
+ FieldType('area', Area),
FieldType("integrities", IntegrityType),
FieldType("remarkabilities", RemarkabilityType),
FieldType("conservatory_state", ConservatoryState),