문제

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