summaryrefslogtreecommitdiff
path: root/archaeological_operations/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-04 17:28:44 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-04 17:28:44 +0200
commitdaee77bd657f0e72767d64dd92f36008e1c47676 (patch)
tree1faf126fd84566f09901a694c144626e0c0df4ce /archaeological_operations/forms.py
parentd7e26ad68e62014d1fbe01c36b0bd1d5688181c2 (diff)
downloadIshtar-daee77bd657f0e72767d64dd92f36008e1c47676.tar.bz2
Ishtar-daee77bd657f0e72767d64dd92f36008e1c47676.zip
QA operation: bulk modification
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r--archaeological_operations/forms.py26
1 files changed, 24 insertions, 2 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py
index f9bf8607c..55a9541ff 100644
--- a/archaeological_operations/forms.py
+++ b/archaeological_operations/forms.py
@@ -39,7 +39,7 @@ from archaeological_operations.utils import parse_parcels
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, \
+ reverse_lazy, TableSelect, get_data_from_formset, QAForm, CustomFormSearch,\
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, \
@@ -597,7 +597,7 @@ class OperationSelect(HistorySelect):
('', '--')] + list(settings.ISHTAR_DPTS)
-class OperationFormSelection(IshtarForm):
+class OperationFormSelection(CustomFormSearch):
SEARCH_AND_SELECT = True
form_label = _(u"Operation search")
associated_models = {'pk': models.Operation}
@@ -1745,3 +1745,25 @@ class AdministrativeActRegisterFormSelection(IshtarForm):
raise forms.ValidationError(
_(u"You should select an administrative act."))
return cleaned_data
+
+
+class QAOperationFormMulti(QAForm):
+ form_admin_name = _(u"Operation - Quick action - Modify")
+ form_slug = "operation-quickaction-modify"
+ base_models = ['qa_operation_type']
+ associated_models = {
+ 'qa_operation_type': models.OperationType,
+ }
+
+ MULTI = True
+ REPLACE_FIELDS = [
+ 'qa_operation_type',
+ ]
+ qa_operation_type = forms.ChoiceField(
+ label=_(u"Operation type"), required=False
+ )
+
+ TYPES = [
+ FieldType('qa_operation_type', models.OperationType),
+ ]
+