I needed to be able to set a list control by value.
So I added three lines to the set_form_control_value method in utils.py
as shown:
----------------------------------------------------------
def set_form_control_value(control, val):
"""
Helper function to deal with setting form values on lists etc.
"""
if isinstance(control, ClientForm.ListControl):
> if val[0:2] == '__':
> control.set(1, val[2:], by_label=True )
> else:
control.set(1, val)
else:
control.value = val
----------------------------------------------------------
Basically you need to prefix the value with __ (two underscores).
It works for me. The syntax may be somewhat and could be improved ;)
Suresh
_______________________________________________
twill mailing list
[email protected]
http://lists.idyll.org/listinfo/twill