@@ -160,23 +160,47 @@ def from_json_definition(cls, definition, hierarchy=None,
160160 choice = field_choices [choice_id ]
161161
162162 data_type_classes = {
163- "select_one" : FormChoiceField ,
164- "select_multiple" : FormChoiceFieldWithMultipleSelect ,
165- "geopoint" : FormGPSField ,
166- "date" : DateField ,
167- "text" : TextField ,
168- "barcode" : TextField ,
169-
170- # calculate is usually not text but for our purpose it's good
171- # enough
172- "calculate" : TextField ,
173- "acknowledge" : TextField ,
174- "integer" : NumField ,
163+ # selects
164+ 'select_one' : FormChoiceField ,
165+ 'select_one_from_file' : FormChoiceField ,
166+ 'select_multiple' : FormChoiceFieldWithMultipleSelect ,
167+ # TODO: Get this to work with FormChoiceFieldWithMultipleSelect
168+ 'select_multiple_from_file' : TextField ,
169+ 'rank' : TextField ,
170+
171+ # date and time
172+ 'date' : DateField ,
173+ 'today' : DateField ,
174+ 'datetime' : TextField ,
175+ 'time' : TextField ,
176+ 'start' : TextField ,
177+ 'end' : TextField ,
178+
179+ # general
180+ 'text' : TextField ,
181+ 'barcode' : TextField ,
182+ 'acknowledge' : TextField ,
183+
184+ # geo
185+ 'geopoint' : FormGPSField ,
186+ 'start-geopoint' : FormGPSField ,
187+
188+ # media
189+ 'video' : TextField ,
190+ 'image' : TextField ,
191+ 'audio' : TextField ,
192+ 'file' : TextField ,
193+ 'background-audio' : TextField ,
194+
195+ # numeric
196+ 'calculate' : TextField ,
197+ 'integer' : NumField ,
175198 'decimal' : NumField ,
199+ 'range' : NumField ,
176200
177201 # legacy type, treat them as text
178- " select_one_external" : partial (TextField , data_type = data_type ),
179- " cascading_select" : partial (TextField , data_type = data_type ),
202+ ' select_one_external' : partial (TextField , data_type = data_type ),
203+ ' cascading_select' : partial (TextField , data_type = data_type ),
180204 }
181205
182206 args = {
0 commit comments