In SQLFORM.__init__, it looks like it checks whether field.type is in 
SQLFORM.widgets, but SQLFORM.widgets includes a 'decimal' key, which 
wouldn't match 'decimal(17,2)'. So looks like it then defaults to the 
string widget. Previously, the string widget used field.type as the input 
class (using a regex, so would only use the 'decimal' part of 
'decimal(17.2)'), but now it always sets it to "string". So, I guess this 
was always a bug in SQLFORM, but was automatically corrected by the string 
widget (which no longer corrects it).

Anthony

On Wednesday, December 14, 2011 7:37:53 PM UTC-5, pbreit wrote:
>
> My fields of type 'decimal' are being classed as 'string' in forms. Is 
> this a Web2py bug or could the problem be in my code somewhere?
>
> 1.99.4
>
>
> Field('start_price', 'decimal(17,2)')
>
>
> <tr id="item_start_price__row"><td class="w2p_fl"><label 
> for="item_start_price" id="item_start_price__label">Start Price: 
> </label></td><td class="w2p_fw"><input class="string" id="item_start_price" 
> name="start_price" type="text" value="" /></td><td class="w2p_fc"></td></tr>
>

Reply via email to