> On Wednesday, July 20, 2011 5:45:21 AM UTC+5:30, Anthony wrote:
>>
>> On Tuesday, July 19, 2011 7:48:35 PM UTC-4, Carlos wrote: 
>>>
>>> So 'truncate' is not being respected when using the previous 'headers' 
>>> format (simple dict of strings).
>>>
>>  
>> Oh, I see, you're right -- that should be fixed.
>>  
>> Anthony
>>
>  
commented lines below are potential fix. (gluon/sqlhtml.py)

                elif field.type in ['string', 'text']:
                    r = str(field.formatter(r))
                    if headers != {}:  # new implement dict
                        if isinstance(headers[colname], dict):
                            if isinstance(headers[colname]['truncate'], int
):
                                r = truncate_string(
                                    r, headers[colname]['truncate'])
#                        elif truncate is not None:
#                            r = truncate_string(r, truncate)
                    elif not truncate is None:
                        r = truncate_string(r, truncate)


I have tested it in "2.3.2 (2012-12-17 15:03:30) stable" it works. (and 
then commented the code so that I get the "out of the box" behavior)

-Mandar

-- 



Reply via email to