default=lambda row: row.check_box_field

Richard

On Tue, Jul 10, 2012 at 4:03 PM, Fabiano Faver <[email protected]> wrote:

> Won`t it apply True to all of them?
>
> this is what I have now with sqlform:
>
> Field('users', requires = IS_IN_DB(db, db.auth_user, '%(email)s',
> multiple=True), widget=SQLFORM.widgets.checkboxes.widget )
>
>
> I imagined there were a argument using  lambda that would set 'checked'
>  for each checkbox  that match the lambda, something like:
>
> Field('users', requires = IS_IN_DB(db, db.auth_user, '%(email)s',
> multiple=True), widget=SQLFORM.widgets.checkboxes.widget, test_checked=
> lambda row: test_to_set_checked_for_each_checkbox )
>
> I'm trying to use 2 FORMs now..
>
> Em terça-feira, 10 de julho de 2012 16h46min48s UTC-3, Richard escreveu:
>
>> in your model Field(..., default=True) or in the controller
>> db.table.field.default=True
>>
>> You also need to use checkbox widget.
>>
>> Richard
>>
>> On Tue, Jul 10, 2012 at 2:39 PM, Fabiano Faver <[email protected]> wrote:
>>
>>> I want to creat something similar to SQLFORM(auth_membership) but I want
>>> the user to choose a group and all users show up as checkboxes and users
>>> who already belong to this group are checked as well.
>>>
>>> I`m downt know how to pre-select these auth_users.
>>>
>>> any tips?
>>>
>>
>>

Reply via email to