> I see your point and I've decided to use this validate_encode feature
> instead of going around it, so basically now I have two inputs for
> each items:
> <p py:for="count, item in enumerate(list_item)" style="padding-top:
> 10px; padding-bottom: 10px;">
> <input type="hidden" name="item-${count}" value="$
> {item[0].uuid_item}"></input>
> <input name="item-${count}" type="text" value="$
> {item[0].label}"></input>
> </p>
I think you should alter that to have it named
uuid-${count}
Then you get two lists, where each index corresponds to a pair of values.
> In the controller I then have a parameter called item and it's bvalue
> is something like this :
> [[u'first_uuid', u'firstLabel'], [u'second_uuid', u'second_item'], and
> so forth ...]
> Thanks for your insight, now all I need is devise a validator that
> makes sure all the labels are not null...
use
@validate(validators=dict(uuid=ForEach(NotNull(), always_list=True,
name=ForEach(NotNull(),always_list=True))
)
def my_controller(self, ...):
...
or something like that - I'm not entirely sure about the always_list
parameter, but there is some parameter like that which will make uuid and
item *always* be a list, even if you only get one pair.
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
-~----------~----~----~----~------~----~------~--~---