upgrade from 0.32 to 0.33 makes forms fail

Bug #498135 reported by Anand Chitipothu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
web.py
New
Undecided
Unassigned

Bug Description

Bug reported in the mailing list:

http://groups.google.com/group/webpy/browse_thread/thread/3d505d3efee41833

The following example used to work in 0.32, but fails in 0.33.

>>> import web
>>> f = web.form.Form(web.form.Checkbox('A', value=False), web.form.Checkbox('B', value=True))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.5/site-packages/web.py-0.33-py2.5.egg/web/form.py", line 284, in __init__
    Input.__init__(self, name, *validators, **attrs)
  File "/Library/Python/2.5/site-packages/web.py-0.33-py2.5.egg/web/form.py", line 124, in __init__
    self.id = attrs.setdefault('id', self.get_default_id())
  File "/Library/Python/2.5/site-packages/web.py-0.33-py2.5.egg/web/form.py", line 288, in get_default_id
    return self.name + '_' + value.replace(' ', '_')
AttributeError: 'bool' object has no attribute 'replace'

And another one:

With 0.33 addatts() does not produce a leading space anymore.

Revision history for this message
SeC (sec) wrote :

Maybe I'm wrong but checkbox should have checked="checked" ? Try web.form.Checkbox('A', checked = True/False)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.