Skip to content

Commit

Permalink
select1 is not a valid bind type
Browse files Browse the repository at this point in the history
  • Loading branch information
yanokwa committed Dec 20, 2019
1 parent 154ae78 commit a377ed8
Show file tree
Hide file tree
Showing 23 changed files with 168 additions and 168 deletions.
2 changes: 1 addition & 1 deletion pyxform/question.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def validate(self):
choice.validate()

def xml_control(self):
assert self.bind["type"] in ["select", "select1", "odk:rank"]
assert self.bind["type"] in ["select", "string", "odk:rank"]
survey = self.get_root()
control_dict = self.control.copy()
# Resolve field references in attributes
Expand Down
8 changes: 4 additions & 4 deletions pyxform/question_type_dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def generate_new_dict():
}
},
"q location": {"control": {"tag": "input"}, "bind": {"type": "geopoint"}},
"select one": {"control": {"tag": "select1"}, "bind": {"type": "select1"}},
"select one": {"control": {"tag": "select1"}, "bind": {"type": "string"}},
"select one external": {"control": {"tag": "input"}, "bind": {"type": "string"}},
"add image prompt": {
"control": {"tag": "upload", "mediatype": "image/*"},
Expand Down Expand Up @@ -176,7 +176,7 @@ def generate_new_dict():
},
"q barcode": {"control": {"tag": "input"}, "bind": {"type": "barcode"}},
"q select": {"control": {"tag": "select"}, "bind": {"type": "select"}},
"select one using": {"control": {"tag": "select1"}, "bind": {"type": "select1"}},
"select one using": {"control": {"tag": "select1"}, "bind": {"type": "string"}},
"rank": {"control": {"tag": "odk:rank"}, "bind": {"type": "odk:rank"}},
"image": {
"control": {"tag": "upload", "mediatype": "image/*"},
Expand Down Expand Up @@ -274,7 +274,7 @@ def generate_new_dict():
"add integer prompt": {"control": {"tag": "input"}, "bind": {"type": "int"}},
"q dateTime": {"control": {"tag": "input"}, "bind": {"type": "dateTime"}},
"date": {"control": {"tag": "input"}, "bind": {"type": "date"}},
"q select1": {"control": {"tag": "select1"}, "bind": {"type": "select1"}},
"q select1": {"control": {"tag": "select1"}, "bind": {"type": "string"}},
"start time": {
"bind": {
"jr:preload": "timestamp",
Expand All @@ -295,7 +295,7 @@ def generate_new_dict():
},
"add select one prompt using": {
"control": {"tag": "select1"},
"bind": {"type": "select1"},
"bind": {"type": "string"},
},
"hidden": {"bind": {"type": "string"}},
"uri:subscriberid": {
Expand Down
2 changes: 1 addition & 1 deletion pyxform/tests/example_xls/instance_xmlns_test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</meta>
</instance_xmlns_test>
</instance>
<bind nodeset="/instance_xmlns_test/yes_or_no" type="select1"/>
<bind nodeset="/instance_xmlns_test/yes_or_no" type="string"/>
<bind jr:preload="uid" nodeset="/instance_xmlns_test/meta/instanceID" readonly="true()" type="string"/>
</model>
</h:head>
Expand Down
18 changes: 9 additions & 9 deletions pyxform/tests/example_xls/spec_test_expected_output.xml
Original file line number Diff line number Diff line change
Expand Up @@ -624,25 +624,25 @@
</meta>
</xlsform_spec_test>
</instance>
<bind nodeset="/xlsform_spec_test/skip_to_end" type="select1"/>
<bind nodeset="/xlsform_spec_test/skip_to_end" type="string"/>
<bind nodeset="/xlsform_spec_test/everything" relevant="not(selected(/xlsform_spec_test/skip_to_end, 'yes'))"/>
<bind nodeset="/xlsform_spec_test/everything/some_text" type="string"/>
<bind nodeset="/xlsform_spec_test/everything/number_label" readonly="true()" type="string"/>
<bind nodeset="/xlsform_spec_test/everything/text_image_audio_video_test" type="string"/>
<bind nodeset="/xlsform_spec_test/everything/display_image_test" readonly="true()" type="string"/>
<bind nodeset="/xlsform_spec_test/everything/autocomplete_test" type="select1"/>
<bind nodeset="/xlsform_spec_test/everything/autocomplete_chars_test" type="select1"/>
<bind nodeset="/xlsform_spec_test/everything/autocomplete_test" type="string"/>
<bind nodeset="/xlsform_spec_test/everything/autocomplete_chars_test" type="string"/>
<bind nodeset="/xlsform_spec_test/everything/a_integer" type="int"/>
<bind constraint=". &lt;= /xlsform_spec_test/everything/a_integer" nodeset="/xlsform_spec_test/everything/a_decimal" type="decimal"/>
<bind nodeset="/xlsform_spec_test/everything/num_repeat_times" relevant="false()" type="int"/>
<bind nodeset="/xlsform_spec_test/everything/repeat_test/group_test/required_text" required="true()" type="string"/>
<bind constraint="not(selected(., 'yes') and selected (., 'no'))" jr:constraintMsg="you can't select yes and no" nodeset="/xlsform_spec_test/everything/repeat_test/group_test/select_multiple_test" required="false()" type="select"/>
<bind nodeset="/xlsform_spec_test/everything/repeat_test/labeled_select_group/label-test" type="select1"/>
<bind nodeset="/xlsform_spec_test/everything/repeat_test/labeled_select_group/list-nolabel-test" required="true()" type="select1"/>
<bind nodeset="/xlsform_spec_test/everything/repeat_test/name/reserved_name_for_field_list_labels_23" type="select1"/>
<bind nodeset="/xlsform_spec_test/everything/repeat_test/name/table_list_question" type="select1"/>
<bind nodeset="/xlsform_spec_test/everything/repeat_test/compact-test" type="select1"/>
<bind nodeset="/xlsform_spec_test/everything/repeat_test/compact-2-test" type="select1"/>
<bind nodeset="/xlsform_spec_test/everything/repeat_test/labeled_select_group/label-test" type="string"/>
<bind nodeset="/xlsform_spec_test/everything/repeat_test/labeled_select_group/list-nolabel-test" required="true()" type="string"/>
<bind nodeset="/xlsform_spec_test/everything/repeat_test/name/reserved_name_for_field_list_labels_23" type="string"/>
<bind nodeset="/xlsform_spec_test/everything/repeat_test/name/table_list_question" type="string"/>
<bind nodeset="/xlsform_spec_test/everything/repeat_test/compact-test" type="string"/>
<bind nodeset="/xlsform_spec_test/everything/repeat_test/compact-2-test" type="string"/>
<bind nodeset="/xlsform_spec_test/everything/acknowledge_test" type="string"/>
<bind nodeset="/xlsform_spec_test/everything/date_test" type="date"/>
<bind nodeset="/xlsform_spec_test/everything/time_test" type="time"/>
Expand Down
22 changes: 11 additions & 11 deletions pyxform/tests/example_xls/widgets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<bind constraint=". &gt;= today()" jr:constraintMsg="only future dates allowed" nodeset="/widgets/my_date" type="date"/>
<bind nodeset="/widgets/my_time" type="time"/>
<bind constraint="not(selected(., 'c') and selected(., 'd'))" jr:constraintMsg="option c and d cannot be selected together" nodeset="/widgets/my_select" type="select"/>
<bind nodeset="/widgets/my_select1" type="select1"/>
<bind nodeset="/widgets/my_select1" type="string"/>
<bind nodeset="/widgets/my_output" readonly="true()" type="string"/>
<bind nodeset="/widgets/my_geopoint" type="geopoint"/>
<bind nodeset="/widgets/my_barcode" type="barcode"/>
Expand All @@ -126,18 +126,18 @@
<bind nodeset="/widgets/numberAsString" type="string"/>
<bind nodeset="/widgets/locationMap" type="geopoint"/>
<bind nodeset="/widgets/dateTime" type="dateTime"/>
<bind nodeset="/widgets/spinner" type="select1"/>
<bind nodeset="/widgets/spinner" type="string"/>
<bind nodeset="/widgets/spinner_all" type="select"/>
<bind nodeset="/widgets/selectadvance" type="select1"/>
<bind nodeset="/widgets/grid_test" type="select1"/>
<bind nodeset="/widgets/grid_test_audio" type="select1"/>
<bind nodeset="/widgets/table_list_test/table_list_test_label" type="select1"/>
<bind nodeset="/widgets/table_list_test/table_list_1" type="select1"/>
<bind nodeset="/widgets/table_list_test/table_list_2" type="select1"/>
<bind nodeset="/widgets/selectadvance" type="string"/>
<bind nodeset="/widgets/grid_test" type="string"/>
<bind nodeset="/widgets/grid_test_audio" type="string"/>
<bind nodeset="/widgets/table_list_test/table_list_test_label" type="string"/>
<bind nodeset="/widgets/table_list_test/table_list_1" type="string"/>
<bind nodeset="/widgets/table_list_test/table_list_2" type="string"/>
<bind nodeset="/widgets/table_list_test2/generated_table_list_label_29" readonly="true()" type="string"/>
<bind nodeset="/widgets/table_list_test2/reserved_name_for_field_list_labels_30" type="select1"/>
<bind nodeset="/widgets/table_list_test2/table_list_3" type="select1"/>
<bind nodeset="/widgets/table_list_test2/table_list_4" type="select1"/>
<bind nodeset="/widgets/table_list_test2/reserved_name_for_field_list_labels_30" type="string"/>
<bind nodeset="/widgets/table_list_test2/table_list_3" type="string"/>
<bind nodeset="/widgets/table_list_test2/table_list_4" type="string"/>
<bind nodeset="/widgets/happy_sad_table_2/happy_sad_second_method" type="select"/>
<bind nodeset="/widgets/happy_sad_table_2/happy_sad_brian2" type="select"/>
<bind nodeset="/widgets/happy_sad_table_2/happy_sad_michael2" type="select"/>
Expand Down
2 changes: 1 addition & 1 deletion pyxform/tests/fixtures/strings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_answers_can_be_imported_from_xml = <?xml version='1.0' ?><data id="build_Wa
test_question_type_string_control = <input ref="/test/enumerator_name"><label ref="jr:itext('/test/enumerator_name:label')"/></input>
test_question_type_string_binding = <bind nodeset="/test/enumerator_name" type="string"/>
test_select_one_question_multilingual_control = <select1 ref="/test/qname"><label ref="jr:itext('/test/qname:label')"/><item><label ref="jr:itext('/test/qname/a:label')"/><value>a</value></item><item><label ref="jr:itext('/test/qname/b:label')"/><value>b</value></item></select1>
test_select_one_question_multilingual_binding = <bind nodeset="/test/qname" type="select1"/>
test_select_one_question_multilingual_binding = <bind nodeset="/test/qname" type="string"/>
test_simple_integer_question_type_multilingual_control = <input ref="/test/integer_q"><label ref="jr:itext('/test/integer_q:label')"/></input>
test_simple_integer_question_type_multilingual_binding = <bind nodeset="/test/integer_q" type="int"/>
test_simple_date_question_type_multilingual_control = <input ref="/test/date_q"><label ref="jr:itext('/test/date_q:label')"/></input>
Expand Down
18 changes: 9 additions & 9 deletions pyxform/tests/test_expected_output/attribute_columns_test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@
</meta>
</attribute_columns_test>
</instance>
<bind nodeset="/attribute_columns_test/skip_to_end" saveIncomplete="true()" type="select1"/>
<bind nodeset="/attribute_columns_test/skip_to_end" saveIncomplete="true()" type="string"/>
<bind nodeset="/attribute_columns_test/everything" relevant="not(selected( /attribute_columns_test/skip_to_end , 'yes'))"/>
<bind nodeset="/attribute_columns_test/everything/my_name" type="string"/>
<bind bindAttribute="test" nodeset="/attribute_columns_test/everything/invalid_variable" readonly="true()" type="string"/>
Expand All @@ -684,20 +684,20 @@
<bind nodeset="/attribute_columns_test/everything/number_label" readonly="true()" type="string"/>
<bind nodeset="/attribute_columns_test/everything/text_image_audio_video_test" type="string"/>
<bind nodeset="/attribute_columns_test/everything/display_image_test" readonly="true()" type="string"/>
<bind nodeset="/attribute_columns_test/everything/autocomplete_test" type="select1"/>
<bind nodeset="/attribute_columns_test/everything/autocomplete_chars_test" type="select1"/>
<bind nodeset="/attribute_columns_test/everything/autocomplete_test" type="string"/>
<bind nodeset="/attribute_columns_test/everything/autocomplete_chars_test" type="string"/>
<bind nodeset="/attribute_columns_test/everything/a_integer" type="int"/>
<bind constraint=". &lt;= /attribute_columns_test/everything/a_integer " nodeset="/attribute_columns_test/everything/a_decimal" type="decimal"/>
<bind calculate="2" nodeset="/attribute_columns_test/everything/repeat_test_count" readonly="true()" type="string"/>
<bind bindAttribute="test" nodeset="/attribute_columns_test/everything/repeat_test"/>
<bind jr:requiredMsg="Custom required message." nodeset="/attribute_columns_test/everything/repeat_test/group_test/required_text" required="true()" type="string"/>
<bind constraint="not(selected(., 'yes') and selected (., 'no'))" jr:constraintMsg="jr:itext('/attribute_columns_test/everything/repeat_test/group_test/select_multiple_test:jr:constraintMsg')" nodeset="/attribute_columns_test/everything/repeat_test/group_test/select_multiple_test" required="false()" type="select"/>
<bind nodeset="/attribute_columns_test/everything/repeat_test/labeled_select_group/label-test" type="select1"/>
<bind nodeset="/attribute_columns_test/everything/repeat_test/labeled_select_group/list-nolabel-test" required="true()" type="select1"/>
<bind nodeset="/attribute_columns_test/everything/repeat_test/name/reserved_name_for_field_list_labels_25" type="select1"/>
<bind nodeset="/attribute_columns_test/everything/repeat_test/name/table_list_question" type="select1"/>
<bind nodeset="/attribute_columns_test/everything/repeat_test/compact-test" type="select1"/>
<bind nodeset="/attribute_columns_test/everything/repeat_test/compact-2-test" type="select1"/>
<bind nodeset="/attribute_columns_test/everything/repeat_test/labeled_select_group/label-test" type="string"/>
<bind nodeset="/attribute_columns_test/everything/repeat_test/labeled_select_group/list-nolabel-test" required="true()" type="string"/>
<bind nodeset="/attribute_columns_test/everything/repeat_test/name/reserved_name_for_field_list_labels_25" type="string"/>
<bind nodeset="/attribute_columns_test/everything/repeat_test/name/table_list_question" type="string"/>
<bind nodeset="/attribute_columns_test/everything/repeat_test/compact-test" type="string"/>
<bind nodeset="/attribute_columns_test/everything/repeat_test/compact-2-test" type="string"/>
<bind bindAttribute="test" nodeset="/attribute_columns_test/everything/acknowledge_test" type="string"/>
<bind bindAttribute="test" nodeset="/attribute_columns_test/everything/date_test" type="date"/>
<bind bindAttribute="test" nodeset="/attribute_columns_test/everything/time_test" type="time"/>
Expand Down
Loading

0 comments on commit a377ed8

Please sign in to comment.