summaryrefslogtreecommitdiff
path: root/archaeological_finds/forms.py
diff options
context:
space:
mode:
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)