diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-01-22 16:44:40 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-04-24 19:38:56 +0200 |
commit | 5b892b087eddf9f4132422259879584c82d1d678 (patch) | |
tree | 5b24e0c2251385e2237c5fed80d7354dceba2943 /archaeological_operations/forms.py | |
parent | f985a5442260b8aadc78946c606538a55ff063da (diff) | |
download | Ishtar-5b892b087eddf9f4132422259879584c82d1d678.tar.bz2 Ishtar-5b892b087eddf9f4132422259879584c82d1d678.zip |
Manage X, Y, Z fields for context records, operations and sites
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r-- | archaeological_operations/forms.py | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index b093b383c..f964375c7 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -40,7 +40,7 @@ from bootstrap_datepicker.widgets import DateField from ishtar_common import widgets from ishtar_common.forms import FinalForm, FormSet, get_now, \ reverse_lazy, TableSelect, get_data_from_formset, \ - ManageOldType, IshtarForm, CustomForm, FieldType, HistorySelect + ManageOldType, IshtarForm, CustomForm, FieldType, FormHeader, HistorySelect from ishtar_common.forms_common import TownFormSet, get_town_field, TownForm from ishtar_common.models import valid_id, Person, Town, \ DocumentTemplate, Organization, get_current_profile, \ @@ -741,6 +741,7 @@ class DashboardForm(IshtarForm): class OperationFormGeneral(CustomForm, ManageOldType): + HEADERS = {} form_label = _(u"General") form_admin_name = _(u"Operation - 010 - General") form_slug = "operation-010-general" @@ -856,6 +857,19 @@ class OperationFormGeneral(CustomForm, ManageOldType): virtual_operation = forms.BooleanField(required=False, label=_(u"Virtual operation")) + HEADERS['x'] = FormHeader(_(u"Coordinates")) + x = forms.FloatField(label=_(u"X"), required=False) + estimated_error_x = forms.FloatField(label=_(u"Estimated error for X"), + required=False) + y = forms.FloatField(label=_(u"Y"), required=False) + estimated_error_y = forms.FloatField(label=_(u"Estimated error for Y"), + required=False) + z = forms.FloatField(label=_(u"Z"), required=False) + estimated_error_z = forms.FloatField(label=_(u"Estimated error for Z"), + required=False) + spatial_reference_system = forms.ChoiceField( + label=_(u"Spatial Reference System"), required=False, choices=[]) + FILE_FIELDS = [ 'report_delivery_date', 'report_processing', @@ -1154,6 +1168,7 @@ class PeriodForm(CustomForm, ManageOldType, forms.Form): class ArchaeologicalSiteForm(ManageOldType): + HEADERS = {} reference = forms.CharField(label=_(u"Reference"), max_length=200) name = forms.CharField(label=_(u"Name"), max_length=200, required=False) periods = forms.MultipleChoiceField( @@ -1162,6 +1177,19 @@ class ArchaeologicalSiteForm(ManageOldType): remains = forms.MultipleChoiceField( label=_("Remains"), choices=[], widget=widgets.Select2Multiple, required=False) + HEADERS['x'] = FormHeader(_(u"Coordinates")) + x = forms.FloatField(label=_(u"X"), required=False) + estimated_error_x = forms.FloatField(label=_(u"Estimated error for X"), + required=False) + y = forms.FloatField(label=_(u"Y"), required=False) + estimated_error_y = forms.FloatField(label=_(u"Estimated error for Y"), + required=False) + z = forms.FloatField(label=_(u"Z"), required=False) + estimated_error_z = forms.FloatField(label=_(u"Estimated error for Z"), + required=False) + spatial_reference_system = forms.ChoiceField( + label=_(u"Spatial Reference System"), required=False, choices=[]) + TYPES = [ FieldType('periods', models.Period, True), |