represent!!

represent=lambda value, row: XML(...) if value is not None else T('N/A')

Richard


On Wed, Jul 17, 2013 at 3:24 PM, Woody <myli...@woodring.us> wrote:

> I have a table definition that uses virtual fields with XML:
>
> db_mydb.define_table('my_table',
>                 Field('ROWID', 'id'),
>                 Field('location', 'string'),
>                 Field('description', 'string', required=False),
>                 Field.Virtual('description_formatted', lambda row:
> XML('<span style="color:#EB0F0F">' + row.description + '</span>'),
>                 etc........
>
> So, using Field.Virtual, I can pass XML with HTML tags to a table. Is
> there a way to do this without having to create a virtual field?  In other
> words, I'd like to be able to add HTML formatting in a normal field
> definition, using XML or helper functions.
>
>  --
>
> ---
> 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/groups/opt_out.
>
>
>

-- 

--- 
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/groups/opt_out.


Reply via email to