I'm using Tosca Widgets 2 on a TurboGears 2 Project,

Does anyone know how to remove the ‘prompt_text’ attribute while instancing a twf.SingleSelectField?

year = twf.SingleSelectField(label="choose a year",options = range(now.year-35,now.year))

What I get in my form is a select element with the values and the first option is an empty option. I want it removed but I don't know how..

Thanks for the help

有帮助吗?

解决方案

Set prompt_text property to None. It should remove the default entry injected by prompt_text.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top