This will do the tricks :

from operator import add
represent=lambda values: reduce(add, [(id, ", ") for id in ['%(first_name)s
%(last_name)s (%(id)s)' %db.auth_user[id] for id in values]])[:-1]

Richard

On Tue, Aug 23, 2011 at 6:10 PM, Richard <ml.richard.vez...@gmail.com>wrote:

> Hello,
>
> I do something like this :
>
> Field('role1','list:reference auth_user')
>
> db.table1.role1.requires =
> IS_IN_DB(role1_set,'auth_user.id
> ',db.auth_user._format,multiple=True,cache=(cache.ram,
> 3600))
>
> That works fine for the form side of the thing... But I lost the
> list:reference auto representation for I don't know what reason...
>
> I try to resotre proper representation in SQLTQBLE and crud.read()
> with :
>
> db.table1.role1.requires = SQLFORM.widgets.multiple.widget
>
> Without success...
>
> I am trying to figure out to make a lambda or my own function to
> manage the representation of the [1,2,3] content of the list:reference
> field type...
>
> Help would be appreciate any how...
>
> Richard

Reply via email to