Yeah as far as I know it does not work like that for the first case. You need to preprocess your defaults with formencode.variabledecode.variable_encode() to change the first case into the second case.
I'm still working on a good repetitions example, are you using javascript? You should look at formencode's NestedVariables, variable_encode and variable_decode to start. On Mon, Nov 2, 2009 at 11:21 AM, Mike Burrows (asplake) <[email protected]> wrote: > > Hi, > > htmlfill.render() doesn't seem to handle repeating elements as I > expect. I've boiled my code down to this example: > > import formencode.htmlfill as htmlfill > template = '<input id="weightings-0.weight" > name="weightings-0.weight" type="text" value="" />' > print htmlfill.render(template, defaults={'weightings': > [{'weight': 1.0}]}) > print htmlfill.render(template, defaults={'weightings-0.weight': > 1.0}) > > Output: > > <input id="weightings-0.weight" name="weightings-0.weight" > type="text" value=""/> > <input id="weightings-0.weight" name="weightings-0.weight" > type="text" value="1.0" /> > > See how the first render fails to populate a value. Am I doing > something wrong? I've using version 1.2.1. > > Are there any good examples out there? Chapter 6 of the 1.1 book > covers some of this but it's not complete (it also has a bug unless > I'm missing something - "person" and "people" are used > inconsistently). > > Thanks, > > Mike > [email protected] > http://positiveincline.com > http://twitter.com/asplake > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
