Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py4web problem using CheckboxWidget with list:reference field #782

Open
davidmanns opened this issue Apr 5, 2023 · 0 comments
Open

py4web problem using CheckboxWidget with list:reference field #782

davidmanns opened this issue Apr 5, 2023 · 0 comments

Comments

@davidmanns
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant