Retrieving multiple similar values from request.params

2007-09-25 Thread voltron
I have asked about something like this before, this is similar but more complicated: I have values coming from my form like this academic_from_year0, academic_till_year0 e.t.c academic_from_year1, academic_till_year1 e.t.c academic_from_year2, academic_till_year2 e.t.c I though about doing

Re: Retrieving multiple similar values from request.params

2007-09-25 Thread voltron
Checking up the docs, I really, really would how this works, it would be magic. variable_decode, according to the docs, would take a list char for decoding into lists, the default is list_char='-', How would that work in my case? I could use a code snippet. Thanks! On Sep 25, 12:28 pm, Clemens

Re: Retrieving multiple similar values from request.params

2007-09-25 Thread James Gardner
Hi voltron, I wrote a blog entry about this here: http://jimmyg.org/2007/09/19/multiple-checkboxes-with-formencode/ Basically you use a custom Schema in a ForEach validator and then use a NestedVarables pre-validator to decode the data to a list. You then need to re-encode it before using

Re: Retrieving multiple similar values from request.params

2007-09-25 Thread Clemens Hermann
On Sep 25, 12:46 pm, voltron [EMAIL PROTECTED] wrote: Checking up the docs, I really, really would how this works, it would be magic. variable_decode, according to the docs, would take a list char for decoding into lists, the default is list_char='-', How would that work in my case? I could

Re: Retrieving multiple similar values from request.params

2007-09-25 Thread voltron
Thanks you very much guys!! Just a few questions: 1. Can I just use the normal request.params for the other parts of the form? 2. The form in question is large, a whole page long, with three multi field repeating sets of data as I described, what would the the stacking of the decorators on my

Re: Retrieving multiple similar values from request.params

2007-09-25 Thread Clemens Hermann
On Sep 25, 3:57 pm, voltron [EMAIL PROTECTED] wrote: 1. Can I just use the normal request.params for the other parts of the form? yes. request.params is imho not altered by formencode validation. Make sure you set allow_extra_fields=True in your schema. Otherwise additional form fields will

Re: Retrieving multiple similar values from request.params

2007-09-25 Thread voltron
What I meant by the the stacking of the decorators was that since I have a large form with different sets of data, example: academic professional resume I would need different validator classes and schemas for them as used in your example above would´nt I? Like below

Re: Retrieving multiple similar values from request.params

2007-09-25 Thread Clemens Hermann
Voltron, On Sep 25, 4:28 pm, voltron [EMAIL PROTECTED] wrote: What I meant by the the stacking of the decorators was that since I have a large form with different sets of data, example: academic professional resume I would need different validator classes and schemas for them as used in

Re: Retrieving multiple similar values from request.params

2007-09-25 Thread voltron
Aha! Now I get it, great explanation Clemens. Thanks! On Sep 25, 5:04 pm, Clemens Hermann [EMAIL PROTECTED] wrote: Voltron, On Sep 25, 4:28 pm, voltron [EMAIL PROTECTED] wrote: What I meant by the the stacking of the decorators was that since I have a large form with different sets of