For those who've had similar problem, the solution, or the bug I've
found is:
articles = widgets.SingleSelectField(label=Articles',
validator = validators.MinLength(0),
options = get_options)
...more widgets and put them in a TableForm
def get_options():
articles = model.Article.select()
opt = [(a.id, a.name) for a in articles]
return opt
part from kid template:
${form.display(value=data)}
where data is something like data['articles'] = just_calculated_value.
This default value would not work unless I remove the validator from
the SingleSelectField. I don't know if this is normal, but it lost me
an hour... I had put the validator because I was getting an exception
that no default validator is found, but later after removing the
validator it didn't complain, I suppose I have changed the options for
this field...
bye, alex
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---