diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-03-24 19:04:54 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:20 +0100 | 
| commit | 8b69114b1932329283f3563077a3cb53149af7c8 (patch) | |
| tree | 75e1154c53fa775498c3fb91d70c6a7f7a6d59f1 /archaeological_warehouse/forms.py | |
| parent | d7faab38f7a4ba4b923e6ffbfca81ed6407ad5aa (diff) | |
| download | Ishtar-8b69114b1932329283f3563077a3cb53149af7c8.tar.bz2 Ishtar-8b69114b1932329283f3563077a3cb53149af7c8.zip | |
Container: add parents - localisation refactoring
Diffstat (limited to 'archaeological_warehouse/forms.py')
| -rw-r--r-- | archaeological_warehouse/forms.py | 11 | 
1 files changed, 10 insertions, 1 deletions
| diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index a7b6c575e..e03918965 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -259,14 +259,23 @@ class ContainerForm(CustomForm, ManageOldType, forms.Form):      form_admin_name = _(u"Container - 010 - General")      form_slug = "container-010-general"      file_upload = True -    extra_form_modals = ["warehouse", "organization", "person"] +    extra_form_modals = ["warehouse", "organization", "person", "container"]      associated_models = {'container_type': models.ContainerType,                           'location': models.Warehouse, +                         'parent': models.Container,                           'responsible': models.Warehouse}      reference = forms.CharField(label=_(u"Ref."), max_length=200)      old_reference = forms.CharField(label=_(u"Old reference"), required=False,                                      max_length=200)      container_type = forms.ChoiceField(label=_(u"Container type"), choices=[]) +    parent = forms.IntegerField( +        label=_("Parent container"), +        widget=widgets.JQueryAutoComplete( +            reverse_lazy('autocomplete-container'), +            associated_model=models.Container, new=True), +        validators=[valid_id(models.Container)], +        required=False +    )      responsible = forms.IntegerField(          label=_(u"Responsible warehouse"),          widget=widgets.JQueryAutoComplete( | 
