Skip to content

py4web problem using CheckboxWidget with list:reference field #782

Open
@davidmanns

Description

@davidmanns

Consider a simple example:

db.define_table('mailings',
Field('listname'),
format='%(listname)s'
)

db.define_table('people',
Field('first'),
Field('last'),
Field('lists', 'list:reference mailings', widget=CheckboxWidget)
)

displaying a CRUD form (using the Edit button in Grid) fails, see below.
removing the widget specification works, but on the desktop the widget displays a scrolling list, where one must ctrl-click to toggle individual selections. The above works on web2py, displaying a nice list of checkboxes. Much better UI on desktop.

Traceback (most recent call last):
File "C:\Users/David/SkyDrive/py4web\py4web\core.py", line 163, in safely
return func()
File "C:\Users/David/SkyDrive/py4web\py4web\core.py", line 503, in
lambda: data.xml(), default=lambda: self._to_html(self._to_unicode(data))
File "C:\Users/David/SkyDrive/py4web\py4web\utils\form.py", line 1022, in xml
return self.structure.xml()
File "C:\Users/David/SkyDrive/py4web\py4web\utils\form.py", line 1016, in structure
return self.helper()["form"]
File "C:\Users/David/SkyDrive/py4web\py4web\utils\form.py", line 937, in helper
helper = self.param.formstyle(
File "C:\Users/David/SkyDrive/py4web\py4web\utils\form.py", line 431, in call
control = field.widget(table, vars)
TypeError: CheckboxWidget() takes no arguments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions