summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/forms.py
diff options
context:
space:
mode:
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),