diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-04-13 13:23:35 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-04-13 13:23:35 +0200 |
| commit | ae9366fc3f24d869fa9cce7c0077d06e6db95571 (patch) | |
| tree | 71d968e3d0b0571b4c1d1bef036774f30e98dbcf /archaeological_finds/forms.py | |
| parent | b790e4875b47e2951a65eedd36dc661079667541 (diff) | |
| download | Ishtar-ae9366fc3f24d869fa9cce7c0077d06e6db95571.tar.bz2 Ishtar-ae9366fc3f24d869fa9cce7c0077d06e6db95571.zip | |
New type of operation: court-ordered seizure with associated fields (refs #4048)
* models
* migrations
* wizard panel
* forms
* sheet
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): |
