IS_IN_SET( [ ('Y',T('Yes')), ('N',T('No')) ] )
Is in set, can receive a list of tuples, where first element is value,
second is text.
On Thu, Jun 30, 2011 at 4:31 PM, Martin Weissenboeck <[email protected]>wrote:
> Hi,
>
> I want to use a SQLFORM with a checkbox. I have tried
>
> ... Field('my_question',
>
> requires=[IS_IN_SET([T('Yes'),T('No')]),],
>
> widget=SQLFORM.widgets.checkboxes.widget,
>
> default=T('No'),
>
> ),...
>
> I got a nice form with the German translations 'Ja' and 'Nein'.
> But now I did not get the English version.
>
> A SELECT like
>
> ... SELECT(
> OPTION(T('Yes'), _value='Y'),
> OPTION(T('No'), _value='N'),
> ) ...
>
>
> works depending on the T-language, but I don't know how to put a "_values"
> into the SQLFORM.
>
> Any hints?
> Regards, Martin
>
--
--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]