Thank Javier,
I tried but not working.
The variable cntnumok contain the number of the container number not the 
state of the container number
Code generate (replace the css class by the value of variable)
<span class="HASU1484890">HASU1484890</span>

Le mercredi 21 novembre 2018 10:51:16 UTC+1, Yann Dulondel a écrit :
>
> Hi all,
> I have a container number and a function that check the number is valid.
> The result of the function is store in field cntnumok (boolean).
> I found that we can change the color with "represent" and found an example 
> in webgroup.
>
> db.articles.conteneur.represent = lambda v, row: SPAN(v, _class=
> 'cnt-false' if db.articles.cntnumok==False else None)
> I understand lambda is an inline function, i want that the if test the 
> value of  "cntnumok" for the row
> How can i have the value of  "cntnumok"  for the row?
> I tried this also
> db.articles.conteneur.represent = lambda v, row: SPAN(v,_class='cnt-false' 
> if row.cntnumok==False else None)
>
> Yann
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to