summaryrefslogtreecommitdiff
path: root/archaeological_finds/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-11-16 17:55:00 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-11-28 11:40:16 +0100
commit9a71511b55615c2b83d8dee18e1863391ab95654 (patch)
treee96f14eb96dd0c44aa0d5e5b8b4f9e8aa2cd110d /archaeological_finds/forms.py
parentf1f226f2fd9e9c741c6d8b56f1f967821dd3336c (diff)
downloadIshtar-9a71511b55615c2b83d8dee18e1863391ab95654.tar.bz2
Ishtar-9a71511b55615c2b83d8dee18e1863391ab95654.zip
Wizard: display selected on final wizard panel
Diffstat (limited to 'archaeological_finds/forms.py')
-rw-r--r--archaeological_finds/forms.py16
1 files changed, 14 insertions, 2 deletions
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)