Jorge Godoy wrote:
> I've been trying to do that for forms. How would you pass just new options
> for some widgets inside, for example, a TableForm?
>
> 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(),
> ),
Hi Jorge,
can you try to change unidades() to be unidades, we want a callable not
what the function returns, that function will then be called every time
at display to update options dynamically.
Ciao
Michele
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---