diff options
Diffstat (limited to 'archaeological_warehouse/forms.py')
-rw-r--r-- | archaeological_warehouse/forms.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index f98adc33a..2e672efd4 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -160,8 +160,10 @@ class WarehouseDeletionForm(FinalForm): confirm_end_msg = _(u"Would you like to delete this warehouse?") -class ContainerForm(ManageOldType, forms.Form): +class ContainerForm(CustomForm, ManageOldType, forms.Form): form_label = _(u"Container") + form_admin_name = _(u"Container - 010 - General") + form_slug = "container-010-general" file_upload = True associated_models = {'container_type': models.ContainerType, 'location': models.Warehouse, @@ -189,16 +191,14 @@ class ContainerForm(ManageOldType, forms.Form): max_length=255, required=False, widget=widgets.ImageFileInput()) comment = forms.CharField(label=_(u"Comment"), widget=forms.Textarea, required=False) + TYPES = [ + FieldType('container_type', models.ContainerType), + ] def __init__(self, *args, **kwargs): if 'limits' in kwargs: kwargs.pop('limits') super(ContainerForm, self).__init__(*args, **kwargs) - self.fields['container_type'].choices = \ - models.ContainerType.get_types( - initial=self.init_data.get('container_type')) - self.fields['container_type'].help_text = \ - models.ContainerType.get_help() def save(self, user): dct = self.cleaned_data @@ -286,7 +286,9 @@ class FindPackagingFormSelection(FindMultipleFormSelection): form_label = _(u"Packaged finds") -class LocalisationForm(forms.Form): +class LocalisationForm(CustomForm, forms.Form): + form_admin_name = _(u"Container - 020 - Localisation") + form_slug = "container-020-localisation" form_label = _(u"Localisation") def __init__(self, *args, **kwargs): |