> {{if not row.nessus_host_summary.critprct == '0':}}
> {{print "<td width=%s bgcolor=#CC0000>%s</td>" %
> (row.nessus_host_summary.critprct, row.nessus_host_summary.count_crit}}
>
{{=TD(row.nessus_host_summary.count_crit, _width=row.nessus_host_summary.
critprct)}}
or:
<td width="{{=row.nessus_host_summary.critprct}}" bgcolor=#CC0000>
{{=row.nessus_host_summary.count_crit}}
</td>
Also, your code implies the critprct field is storing the percentages as
strings. Probably better to store as numeric values, in which case, the if
statement can be changed to:
{{if row.nessus_host_summary.critprct:}}
This works because 0 numeric values return False.
Anthony
--
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.