From 5b892b087eddf9f4132422259879584c82d1d678 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 22 Jan 2019 16:44:40 +0100 Subject: Manage X, Y, Z fields for context records, operations and sites --- archaeological_context_records/forms.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'archaeological_context_records/forms.py') diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py index ae25e0abe..7566dcc71 100644 --- a/archaeological_context_records/forms.py +++ b/archaeological_context_records/forms.py @@ -33,7 +33,7 @@ from archaeological_context_records import models from ishtar_common.forms import FinalForm, FormSet, \ reverse_lazy, get_form_selection, TableSelect, ManageOldType, CustomForm, \ - FieldType, CustomFormSearch, IshtarForm, HistorySelect + FieldType, CustomFormSearch, IshtarForm, FormHeader, HistorySelect from ishtar_common.forms_common import get_town_field from archaeological_operations.forms import OperationSelect, ParcelField, \ RecordRelationsForm as OpeRecordRelationsForm, RecordRelationsFormSetBase @@ -135,6 +135,7 @@ class RecordFormSelection(CustomFormSearch): class RecordFormGeneral(CustomForm, ManageOldType): + HEADERS = {} form_label = _("General") form_admin_name = _(u"Context record - 020 - General") form_slug = "contextrecord-020-general" @@ -182,6 +183,19 @@ class RecordFormGeneral(CustomForm, ManageOldType): label=_(u"Location"), widget=forms.Textarea, required=False, validators=[validators.MaxLengthValidator(200)]) + 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('unit', models.Unit), FieldType('excavation_technic', models.ExcavationTechnicType), -- cgit v1.2.3