diff options
Diffstat (limited to 'archaeological_finds/forms.py')
-rw-r--r-- | archaeological_finds/forms.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index 6811f7773..15d86f91f 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -152,6 +152,7 @@ class FindForm(CustomForm, ManageOldType): get_first_base_find__excavation_id = forms.CharField( label=_(u"Excavation ID"), required=False) museum_id = forms.CharField(label=_(u"Museum ID"), required=False) + seal_number = forms.CharField(label=_(u"Seal number"), required=False) mark = forms.CharField(label=_(u"Mark"), required=False) HEADERS['description'] = FormHeader(_(u"Description")) @@ -235,25 +236,24 @@ class FindForm(CustomForm, ManageOldType): FieldType('communicabilitie', models.CommunicabilityType, is_multiple=True), FieldType('get_first_base_find__batch', models.BatchType), + FieldType('get_first_base_find__spatial_reference_system', + SpatialReferenceSystem), ] + PROFILE_FILTER = { + 'mapping': [ + 'get_first_base_find__x', 'get_first_base_find__y', + 'get_first_base_find__z', 'get_first_base_find__estimated_error_x', + 'get_first_base_find__estimated_error_y', + 'get_first_base_find__estimated_error_z', + 'get_first_base_find__spatial_reference_system' + ], + } def __init__(self, *args, **kwargs): + context_record = kwargs.pop('context_record') super(FindForm, self).__init__(*args, **kwargs) - if not get_current_profile().mapping: - for k in ['get_first_base_find__x', 'get_first_base_find__y', - 'get_first_base_find__z', - 'get_first_base_find__estimated_error_x', - 'get_first_base_find__estimated_error_y', - 'get_first_base_find__estimated_error_z', - 'get_first_base_find__spatial_reference_system',]: - self.fields.pop(k) - else: - srs = 'get_first_base_find__spatial_reference_system' - self.fields[srs].choices = \ - SpatialReferenceSystem.get_types( - initial=self.init_data.get(srs)) - self.fields[srs].help_text = \ - SpatialReferenceSystem.get_help() + if not context_record.operation.operation_type.judiciary: + self.fields.pop('seal_number') self.fields['checked'].choices = models.CHECK_CHOICES def clean(self): |