always set variable names (#1405)

This commit is contained in:
Frédéric Péters 2012-05-08 14:46:59 +02:00
parent 10ee5d1eb6
commit 4babbf3d2c
1 changed files with 3 additions and 5 deletions

View File

@ -33,15 +33,13 @@ def get_dict_with_varnames(fields, data):
if field.convert_value_to_str:
value = field.convert_value_to_str(value)
else:
value = field.label
value = ''
# add it as f$n$
if data is not None or not field.varname:
new_data['f%s' % field.id] = value
new_data['f%s' % field.id] = value
# also add it as 'field_' + normalized(field label)
identifier_name = qommon.misc.simplify(field.label, space = '_')
if data is not None:
new_data['field_' + identifier_name] = value
new_data['field_' + identifier_name] = value
# and finally add it as its manually defined variable name
if field.varname: