handle correctly unlabeled option values in DataForms

This commit is contained in:
Yann Leboulanger 2006-01-04 16:03:42 +00:00
parent edaa70740e
commit 3c69470be2
1 changed files with 3 additions and 2 deletions

View File

@ -1238,13 +1238,14 @@ class Connection:
for option_tag in option_tags:
dic[i]['options'][j] = {}
label = option_tag.getAttr('label')
if label:
dic[i]['options'][j]['label'] = label
tags = option_tag.getTags('value')
dic[i]['options'][j]['values'] = []
for tag in tags:
dic[i]['options'][j]['values'].append(tag.getData())
j += 1
if not label:
label = dic[i]['options'][j]['values'][0]
dic[i]['options'][j]['label'] = label
if not dic[i].has_key('values'):
dic[i]['values'] = [dic[i]['options'][0]['values'][0]]
i += 1