> I'm filling my form using the following:
>
> form.fill(source=db.select('configuration')[0])
>
> but when it is rendered any fields with a zero value in the database
> are rendered as blank. Looking through the code in form.py it looks
> like the following code is the culprit:
>
> def render(self):
>  attrs = self.attrs.copy()
>  attrs['type'] = self.get_type()
>  if self.value:
>    attrs['value'] = self.value
>  attrs['name'] = self.name
>  return '<input %s/>' % attrs
>
> I suspect that the if statement would be better phrased as:
>
>  if self.value is not None:
>    attrs['value'] = self.value

Fixed.

http://github.com/webpy/webpy/commit/25c5a230a865216b0afb428e823f342de080a57a

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en.

Reply via email to