summaryrefslogtreecommitdiff
path: root/archaeological_context_records/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-05-15 11:34:32 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-05-15 11:34:32 +0200
commit54d6c8789255aa5500df6dc583a8fdbe96b8442a (patch)
tree9b6101e1df20be739157df2c8d6f391119bf3e48 /archaeological_context_records/forms.py
parentc3e4c309deb686685e34a441445b6104ba4913a7 (diff)
parentc18fccf766ea9fd82ca82d8e4a7938c83512c416 (diff)
downloadIshtar-54d6c8789255aa5500df6dc583a8fdbe96b8442a.tar.bz2
Ishtar-54d6c8789255aa5500df6dc583a8fdbe96b8442a.zip
Merge branch 'master' into develop
Conflicts: archaeological_finds/forms_treatments.py
Diffstat (limited to 'archaeological_context_records/forms.py')
-rw-r--r--archaeological_context_records/forms.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py
index 522c69deb..91effb397 100644
--- a/archaeological_context_records/forms.py
+++ b/archaeological_context_records/forms.py
@@ -40,7 +40,7 @@ from ishtar_common.forms import FinalForm, FormSet, \
reverse_lazy, get_form_selection, TableSelect, ManageOldType
from ishtar_common.forms_common import get_town_field, SourceSelect
from archaeological_operations.forms import OperationSelect, ParcelField,\
- RecordRelationsForm as OpeRecordRelationsForm
+ RecordRelationsForm as OpeRecordRelationsForm, RecordRelationsFormSetBase
class OperationFormSelection(forms.Form):
@@ -77,7 +77,7 @@ class RecordSelect(TableSelect):
datings__period = forms.ChoiceField(label=_(u"Period"), choices=[])
unit = forms.ChoiceField(label=_(u"Unit type"), choices=[])
parcel = ParcelField(label=_(u"Parcel (section/number/public domain)"))
- relation_types = forms.MultipleChoiceField(
+ cr_relation_types = forms.MultipleChoiceField(
label=_(u"Search within relations"), choices=[],
widget=forms.CheckboxSelectMultiple)
@@ -87,8 +87,8 @@ class RecordSelect(TableSelect):
self.fields['datings__period'].help_text = Period.get_help()
self.fields['unit'].choices = models.Unit.get_types()
self.fields['unit'].help_text = models.Unit.get_help()
- self.fields['relation_types'].choices = models.RelationType.get_types(
- empty_first=False)
+ self.fields['cr_relation_types'].choices = \
+ models.RelationType.get_types(empty_first=False)
self.fields['ope_relation_types'].choices = OpeRelationType.get_types(
empty_first=False)
@@ -98,9 +98,9 @@ class RecordSelect(TableSelect):
ids.append('parcel_0')
ids.append('parcel_1')
ids.append('parcel_2')
- ids.pop(ids.index('relation_types'))
- for idx, c in enumerate(self.fields['relation_types'].choices):
- ids.append('relation_types_{}'.format(idx))
+ ids.pop(ids.index('cr_relation_types'))
+ for idx, c in enumerate(self.fields['cr_relation_types'].choices):
+ ids.append('cr_relation_types_{}'.format(idx))
ids.pop(ids.index('ope_relation_types'))
for idx, c in enumerate(self.fields['ope_relation_types'].choices):
ids.append('ope_relation_types_{}'.format(idx))
@@ -302,7 +302,8 @@ class RecordRelationsForm(OpeRecordRelationsForm):
if crs:
self.fields['right_record'].choices = [('', '-' * 2)] + crs
-RecordRelationsFormSet = formset_factory(RecordRelationsForm, can_delete=True)
+RecordRelationsFormSet = formset_factory(
+ RecordRelationsForm, can_delete=True, formset=RecordRelationsFormSetBase)
RecordRelationsFormSet.form_label = _(u"Relations")