Hmmm... not exactly good. I had to make a function
def replace_to_html( s ):
try:
return XML( s.replace( '\n', '' ) )
except:
return s
because s is None it has no replace function...
And call:
db.some_table.some_text.represent = lambda s: replace_to_html( s )
Works. Thank you!
db.some_table.some_text.writable = False
db.some_table.some_text.represent = lambda s: XML(s.replace('\n',''))
On May 3, 8:36 am, szimszon wrote:
> Is there a way to replace \n with and space with in the
> displayed value of text field if the field is writable=False and displayed
> in crud f
I need it only writable=False I need to display it like:
"
some text
other text
another line
"
but I got only:
"some textother textanother line"
On 3 mayo, 09:36, szimszon wrote:
> Is there a way to replace \n with and space with in the
> displayed value of text field if the field is writable=False and displayed
> in crud form:
>
> db.define_table('some_table',
> Field('some_text','text',writable=False)
> )
>
> crud.update(db.some
5 matches
Mail list logo