oops,
when I remove requires= completly,
i.e. when I run with default IS_IN_DB validator,

then I see a different widget (probably a proper one):
all choices listed, and I can choose more rows using Ctrl+click.

So probably I should write better
requires=....

When I replace: [IS_NOT_EMPTY(), IS_IN_DB()]
so: IS_IN_DB()
then it works, but validation will not fail if no item is selected.
When I use: IS_EMPTY_OR(IS_IN_DB())
it works exactly so.

I have workaround:
IS_IN_DB(...., multiple=(1,9999999))

Is this the best solution?


Dne čtvrtek 12. května 2016 19:06:14 UTC+2 Mirek Zvolský napsal(a):
>
> Friends, what I do wrong?
>
> I want that user always can see 'name' instead of plain 'id'
>
> In model I have related table with format:
> format=lambda r: r.name
>
> And in the master table I define the list:reference field so:
>         Field('ekosystemtypes', 'list:reference ekosystemtypes',
>               requires=[IS_NOT_EMPTY(), IS_IN_DB(db, db.ekosystemtypes.id, 
> '%(name)s', multiple=True)]),
>
> In appadmin in grid I see 'name's - this works well.
> In appadmin I see the field together with [+][-] buttons - this works well.
>
> But instead of to see option popup with 'name's,
> I see (and user can choose) only plain 'id's.
>
> What I should do better?
>    Some mistake?
>    Should I explicitly assign some widget?
>    or this simple cannot work with list:reference?
> Thanks,
> Mirek
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to