'represent' is not working for me. Here's my code: ----------------------- db_mydb.define_table('my_table', Field('ROWID', 'id'), Field('location', 'string'), Field('other_field', 'string'), migrate=False)
db_mydb.my_table.location.represent=lambda location,row: XML(T('This is a test')) ------------------------ Doesn't matter what I put in the represent declaration, the data displayed in the table doesn't change. On Wednesday, July 17, 2013 3:34:21 PM UTC-4, Richard wrote: > > 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 <myl...@woodring.us > <javascript:>>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+un...@googlegroups.com <javascript:>. >> 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.