Try this:
db.table.field = Field.Virtual('alert_time',
lambda row: XML(str(<a calculation that generates an
integer>) + ' hours<br/>' + str(<references a field that has type
datetime>)))
On Sunday, 14 July 2013 17:40:28 UTC-5, Woody wrote:
>
> I have a virtual field that concatenates 2 fields like this:
>
> Field.Virtual('alert_time',
> lambda row: (str(<a calculation that generates an
> integer>) + ' hours | ' + str(<references a field that has type datetime>))
>
>
> The result goes into a table cell and looks something like this: "8 hours
> 2013-07-14 09:10:20"
>
> I want to force line breaks so that it will look like this
> 8 hours
> 2013-07-14
> 09:10:20
>
> I tried inserting line breaks using /n or <br /> in the text like this:
>
> lambda row: (str(<a calculation that generates an integer>) + ' hours/n'
> + str(<references a field that has type datetime>))
>
> but they printed out as string literals in the table. How can I format
> the text for this cell?
>
--
---
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/groups/opt_out.