diff options
Diffstat (limited to 'archaeological_finds/forms.py')
-rw-r--r-- | archaeological_finds/forms.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index 3558b0346..7688b2340 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -129,6 +129,7 @@ class FindForm(ManageOldType, forms.Form): 'object_type': models.ObjectType, 'preservation_to_consider': models.PreservationType, 'integritie': models.IntegrityType, + 'get_first_base_find__batch': models.BatchType, 'remarkabilitie': models.RemarkabilityType, 'get_first_base_find__spatial_reference_system': SpatialReferenceSystem} @@ -139,7 +140,7 @@ class FindForm(ManageOldType, forms.Form): description = forms.CharField(label=_("Description"), widget=forms.Textarea, required=False) get_first_base_find__batch = forms.ChoiceField( - label=_(u"Batch/object"), choices=models.IS_ISOLATED_CHOICES, + label=_(u"Batch/object"), choices=[], required=False) is_complete = forms.NullBooleanField(label=_(u"Is complete?"), required=False) @@ -225,11 +226,19 @@ class FindForm(ManageOldType, forms.Form): SpatialReferenceSystem.get_help() self.fields['checked'].choices = models.CHECK_CHOICES self.fields['material_type'].help_text = models.MaterialType.get_help() + + self.fields['get_first_base_find__batch'].choices = \ + models.BatchType.get_types( + initial=self.init_data.get('get_first_base_find__batch')) + self.fields['get_first_base_find__batch'].help_text = \ + models.BatchType.get_help() + self.fields['conservatory_state'].choices = \ models.ConservatoryState.get_types( initial=self.init_data.get('conservatory_state')) self.fields['conservatory_state'].help_text = \ models.ConservatoryState.get_help() + self.fields['preservation_to_consider'].choices = \ models.PreservationType.get_types( empty_first=False, @@ -352,8 +361,7 @@ class FindSelect(TableSelect): choices=[]) base_finds__find__description = forms.CharField(label=_(u"Description")) base_finds__batch = forms.ChoiceField( - label=_(u"Batch/object"), - choices=[('', '--')] + list(models.IS_ISOLATED_CHOICES)) + label=_(u"Batch/object"), choices=[]) checked = forms.ChoiceField(label=_("Check")) image = forms.NullBooleanField(label=_(u"Has an image?")) @@ -369,6 +377,12 @@ class FindSelect(TableSelect): models.ConservatoryState.get_types() self.fields['conservatory_state'].help_text = \ models.ConservatoryState.get_help() + + self.fields['base_finds__batch'].choices = \ + models.BatchType.get_types() + self.fields['base_finds__batch'].help_text = \ + models.BatchType.get_help() + self.fields['object_types'].choices = \ models.ObjectType.get_types() self.fields['checked'].choices = \ |