Skip to content

Commit

Permalink
remove 'meta' field from form
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Jan 3, 2017
1 parent d4768cd commit 7fa6165
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 18 deletions.
4 changes: 0 additions & 4 deletions tests/files/input_types/detail.html
Expand Up @@ -48,10 +48,6 @@ <h1>{{label}}</h1>
<th>Date+time field</th>
<td>{{datetime_field_label}}</td>
</tr>
<tr>
<th></th>
<td>{{meta}}</td>
</tr>
</table>
</div>
<div class="ui-block-b">
Expand Down
4 changes: 0 additions & 4 deletions tests/files/nestedfk/detail.html
Expand Up @@ -54,10 +54,6 @@ <h1>{{label}}</h1>
{{/nested}}
</td>
</tr>
<tr>
<th></th>
<td>{{meta}}</td>
</tr>
</table>
{{#items}}
<h3>Photo</h3>
Expand Down
4 changes: 0 additions & 4 deletions tests/files/repeat/detail.html
Expand Up @@ -54,10 +54,6 @@ <h1>{{label}}</h1>
{{/nested}}
</td>
</tr>
<tr>
<th></th>
<td>{{meta}}</td>
</tr>
</table>
</div>
</div>
Expand Down
4 changes: 0 additions & 4 deletions tests/files/select/detail.html
Expand Up @@ -34,10 +34,6 @@ <h1>{{label}}</h1>
<th>Pick a Site ID</th>
<td>{{site_label}}</td>
</tr>
<tr>
<th></th>
<td>{{meta}}</td>
</tr>
</table>
</div>
</div>
Expand Down
9 changes: 7 additions & 2 deletions xlsconv/parser.py
Expand Up @@ -15,6 +15,12 @@ def parse_xls(file_or_name):
filename = fileobj.name
xform_json = parse_file_to_json(filename, file_object=fileobj)

# Remove 'meta' field from form
xform_json['children'] = [
field for field in xform_json['children']
if field['type'] != 'group' or field['name'] != 'meta'
]

def process_fields(root):
for field in root['children']:
cons = field.get('bind', {}).get('constraint', '')
Expand All @@ -26,8 +32,7 @@ def process_fields(root):

if field['type'] in GROUP_TYPES:
process_fields(field)
if not field['name'] == "meta":
field['wq:nested'] = True
field['wq:nested'] = True
if field['type'] == 'repeat':
field['wq:many'] = True
continue
Expand Down

0 comments on commit 7fa6165

Please sign in to comment.