Jorge Godoy <[EMAIL PROTECTED]> writes:
> Example:
>
> ================================================================================
> def unidades():
> unidades = [[unidade.id, unidade.simbolo]
> for unidade in model.Unidade.select(
> orderBy = model.Unidade.q.simbolo,
> )]
> return unidades
>
> formulario_conversao_unidades_de_medida = widgets.TableForm(
> [
> widgets.SingleSelectField(name = 'origem',
> label = lazy_gettext('Unidade de Origem'),
> css_classes = ['required'],
> validator = validators.Int(not_empty = True),
> options = unidades(),
> ),
> widgets.SingleSelectField(name = 'destino',
> label = lazy_gettext('Unidade de Destino'),
> css_classes = ['required'],
> validator = validators.Int(not_empty = True),
> options = unidades(),
> ),
> widgets.TextField(attrs = {'size':16, 'maxlength':15},
> name = 'multiplicador',
> label = lazy_gettext('Fator Multiplicador'),
> css_classes = ['required'],
> validator = validators.Number(not_empty = True),
> ),
> widgets.HiddenField(name = 'conversao_unidade_id',
> validator = validators.Int(if_empty = None),
> ),
> ],
> )
> ================================================================================
Oops! My bad here.
I have to pass it like 'unidades' instead of 'unidades()' for the options
value. If I pass the callable it works as expected.
Sorry to bother ;-)
--
Jorge Godoy <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---