On May 18, 2007, at 1:00 AM, Graham Stratton wrote:

>
>
>> Should this do it?
>>
>> (There's also docs additions in the attached version of the patch)
>>
>> --- formencode/api.py   (revision 2695)
>> +++ formencode/api.py   (working copy)
>> @@ -352,6 +352,9 @@
>>           try:
>>               if self.strip and isinstance(value, (str, unicode)):
>>                   value = value.strip()
>> +            elif hasattr(value, 'mixed'):
>> +                # Support Paste's MultiDict
>> +                value = value.mixed()
>>               if self.is_empty(value):
>>                   if self.not_empty:
>>                       raise Invalid(self.message('empty', state),
>> value, state)
>
> Does this cover htmlfill as well?
>

As far as I can tell htmlfill doesn't handle multiple parameter names  
correctly unless you're using the variable_decode syntax. What I mean  
is given the MultiDict:

MultiDict([('hello', '1'), ('hello', '2'), ('hello', 'hi')])

and html:

           <input id="hello" name="hello" type="text" value="" />
           <input id="hello" name="hello" type="text" value="" />
           <input id="hello" name="hello" type="text" value="" />

When passing the MultiDict to htmlfill all three values are filled  
with: "1". When I pass in an actual python dict from MultiDict.mixed 
(), the three values are all filled with: "['1', '2', 'hi']"

--
Philip Jenvey



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to