diff options
Diffstat (limited to 'archaeological_warehouse')
-rw-r--r-- | archaeological_warehouse/forms.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index 9ff09bde4..5fcc105cd 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -266,10 +266,10 @@ class ContainerForm(CustomForm, ManageOldType, forms.Form): associated_models = {'container_type': models.ContainerType, 'location': models.Warehouse, 'parent': models.Container} - reference = forms.CharField(label=_(u"Ref."), max_length=200) - old_reference = forms.CharField(label=_(u"Old reference"), required=False, + reference = forms.CharField(label=_("Ref."), max_length=200) + old_reference = forms.CharField(label=_("Old reference"), required=False, max_length=200) - container_type = forms.ChoiceField(label=_(u"Container type"), choices=[]) + container_type = forms.ChoiceField(label=_("Container type"), choices=[]) location = forms.IntegerField( label=_("Current location (warehouse)"), widget=widgets.JQueryAutoComplete( @@ -333,6 +333,7 @@ class ContainerForm(CustomForm, ManageOldType, forms.Form): dct['container_type'] = models.ContainerType.objects.get( pk=dct['container_type']) dct['location'] = models.Warehouse.objects.get(pk=dct['location']) + dct['parent'] = models.Container.objects.get(pk=dct['parent']) new_item = models.Container(**dct) new_item.save() return new_item |