that is a great idea, thanks Diez, I will take it in account
On 19 sep, 20:15, "Diez B. Roggisch" <[email protected]> wrote:
> killer chicken schrieb:
>
>
>
> > I want to send an array of values through the request and process them
> > in the controller
> > I have a table with multiples input dinamically created with a
> > javascript function whose values are the data to send, I've set the
> > "name" attribute of those input as probabilidades[i].
> > Data values are created by the user and I have no control about how
> > many data it will be created.
>
> > In php if I do the same, I will receive in the controller an array
> > named $_REQUEST['probabilidades'] with all the values dinamically
> > generated
>
> > In TG, I receive this: kw['probabilidades[0]'], kw['probabilidades
> > [1]']....kw['probabilidades[9]']....
>
> > How can I bind the values into an array in an effective way, or send
> > the data in an array?
>
> This should get you going:
>
> http://formencode.org/Validator.html#http-html-form-input
>
> I don't think you need a validator to make the formencode-value-decoding
> work, but it certainly is a good idea.
>
> Alternatively, it might be enough to have a validator on the form-action
> like this:
>
> @expose(...)
> @validate(dict(probabilidades=ForEach(convert_to_list=True)))
> def submit_action(self, probabiliades=None):
> ...
>
> Diez
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---