Hi, I am using the follow to highlight a date field where the date is greater then the current date.
db.stock_task.ESI_withhold_until_date.represent = lambda v,row: SPAN(datetime.date(v),_class='withhold' if v >datetime.date.today() else None) db.stock_task.ESI_withhold_until_date.represent = lambda v,row: SPAN(datetime.date(v),_class='withhold' if v and v> datetime.date.today() else None) Traceback (most recent call last): File "/home/tony/web2py/gluon/restricted.py", line 227, in restricted exec ccode in environment File "/home/tony/web2py/applications/cps5c/controllers/default.py" <http://127.0.0.1:8000/admin/default/edit/cps5c/controllers/default.py>, line 562, in <module> File "applications/cps5c/modules/plugin_sqleditable/editable.py", line 415, in extract r=func() File "/home/tony/web2py/gluon/tools.py", line 3774, in f return action(*a, **b) File "/home/tony/web2py/applications/cps5c/controllers/default.py" <http://127.0.0.1:8000/admin/default/edit/cps5c/controllers/default.py>, line 268, in stock_tasks db.stock_task.created_by, File "/home/tony/web2py/gluon/sqlhtml.py", line 2717, in grid nvalue = field.represent(value, row) File "/home/tony/web2py/applications/cps5c/models/db1.py" <http://127.0.0.1:8000/admin/default/edit/cps5c/models/db1.py>, line 144, in <lambda> db.stock_task.ESI_withhold_until_date.represent = lambda v,row: SPAN(datetime.date (v),_class='withhold' if v > datetime.date.today() else None) TypeError: an integer is required if I use the following works fine. db.stock_task.withhold_until_date.represent = lambda v, row: SPAN(prettydate(v),_class='withhold' if v and v>datetime.date.today() else None) any help appreciated cheers -- 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.