I should add that it would be easy for me to customize form elements this
way, but I would like to do so in a way that does not sacrifice existing
form functionality and is just generally in conformance with the web2py
way.
On Saturday, September 8, 2012 2:22:21 AM UTC-4, Mike Girard wrote:
>
> I have a checkboxes widget which I invoke like so:
>
> form = SQLFORM.factory(
> Field('test',
> type='string',
> requires=IS_IN_DB(db, db.city.name_url, '%(name)s',
> multiple=True),
> widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v,
> style='divs'),
> default = 'New-York'), formstyle='divs')
>
> I use requires=IS_IN_DB solely to populate the checkboxes with fresh data.
> I don't really need the validation. Now I would prefer to spread the data
> in the one table being used across multiple checkbox groups. Is there an
> out-of-the-box way to populate form elements with queries instead of just
> binding them to tables?
>
--