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.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py
index 42b8e1749..110f01c9b 100644
--- a/archaeological_warehouse/forms.py
+++ b/archaeological_warehouse/forms.py
@@ -265,6 +265,7 @@ class ContainerForm(CustomForm, ManageOldType, forms.Form):
extra_form_modals = ["warehouse", "organization", "person", "container"]
associated_models = {'container_type': models.ContainerType,
'location': models.Warehouse,
+ 'collection': models.Warehouse,
'parent': models.Container}
reference = forms.CharField(label=_("Ref."), max_length=200)
old_reference = forms.CharField(label=_("Old reference"), required=False,
@@ -285,6 +286,15 @@ class ContainerForm(CustomForm, ManageOldType, forms.Form):
validators=[valid_id(models.Container)],
required=False
)
+ collection = forms.IntegerField(
+ label=_("Collection"),
+ widget=widgets.JQueryAutoComplete(
+ reverse_lazy('autocomplete-warehouse'),
+ associated_model=models.Warehouse, new=True),
+ validators=[valid_id(models.Warehouse)],
+ help_text=_("Automatically attached to the current warehouse if not "
+ "filled.")
+ )
comment = forms.CharField(label=_("Comment"),
widget=forms.Textarea, required=False)
TYPES = [