From 9a71511b55615c2b83d8dee18e1863391ab95654 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 16 Nov 2018 17:55:00 +0100 Subject: Wizard: display selected on final wizard panel --- archaeological_finds/forms.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'archaeological_finds/forms.py') diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index 663ab3663..4df6629e1 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -53,7 +53,8 @@ from bootstrap_datepicker.widgets import DatePicker from ishtar_common import widgets from ishtar_common.forms import CustomForm, CustomFormSearch, FormSet, \ FloatField, reverse_lazy, TableSelect, get_now, FinalForm, \ - ManageOldType, FieldType, IshtarForm, FormHeader, QAForm, HistorySelect + ManageOldType, FieldType, IshtarForm, FormHeader, QAForm, HistorySelect, \ + PkWizardSearch from ishtar_common.forms_common import get_town_field from ishtar_common.models import valid_id, valid_ids, get_current_profile, \ SpatialReferenceSystem, Area, OperationType @@ -910,8 +911,19 @@ class FindDeletionForm(FinalForm): confirm_end_msg = _(u"Would you like to delete this find?") -class UpstreamFindFormSelection(FindFormSelection): +class UpstreamFindFormSelection(PkWizardSearch, FindFormSelection): form_label = _(u"Upstream find") + current_model = models.Find + pk_key = 'resulting_pk' + + pk = forms.CharField( + label="", required=False, + widget=widgets.DataTable( + reverse_lazy('get-find'), + FindSelect, current_model, + multiple_select=True, + source_full=reverse_lazy('get-find-full')), + validators=[valid_ids(current_model)]) def __init__(self, *args, **kwargs): super(UpstreamFindFormSelection, self).__init__(*args, **kwargs) -- cgit v1.2.3