durusmail: quixote-users: Help setting RadiobuttonsWidget options
Help setting RadiobuttonsWidget options
2004-12-27
2004-12-27
Help setting RadiobuttonsWidget options
Ksenia Marasanova
2004-12-27
> Which makes me wonder why is the third element ('key') turning into a
> value, what the first element is for, and how this relates to redisplaying
> the form if there's a user error?

You need the third element if there are duplicate descriptions,
because the widget uses 'description' (or 'key') instead of value for
"value" property of the html tag. But in Python code the widget always
returns 'value' (the first element). The nicest thing is that you can
pass list with class instances to the widget (that explains the
"object" name of the first element), and after form submition get the
selected instance back. Check out this example:
http://mail.mems-exchange.org/pipermail/quixote-users/2003-November/002170.html


> Should I redisplay it as
>     value = request.form['relation']
> or should I be doing something with this 'object' element?

The value of redisplayed widget is authomatically set when widget is parsed.

--
Ksenia

reply