[web2py] Re: text field display when writable=False

2011-05-04 Thread szimszon
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 )

[web2py] Re: text field display when writable=False

2011-05-04 Thread szimszon
Works. Thank you!

[web2py] Re: text field display when writable=False

2011-05-03 Thread DenesL
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

[web2py] Re: text field display when writable=False

2011-05-03 Thread szimszon
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"

[web2py] Re: text field display when writable=False

2011-05-03 Thread Jose
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