I would like to retain the the spacing information (next line, /n)
when I retrieve text data from the database.
for example, when I put following into a form
test
test
test
this is what I get out of the database in the views.
test test test
I'd like it retrieve
test
test
test
here is my code
IN CONTROLLERS (default.py, has two functions)
def create_text():
form = SQLFORM(db.task, fields=[ 'body'])
if form.accepts(request.vars, session):
session.flash = 'document saved'
redirect(URL(r=request,f='review', args =
form.vars.id))
elif form.errors: response.flash = 'page not saved'
return dict(form=form)
def review():
thistask=db((
db.task.id==request.args[0])&(db.task.auth_user_id
==
session.auth.user.id )).select()[0]
return dict(body = thistask.body)
IN VIEWS (there are two files)
create_text.html (view to create text)
{{=form}}
review.html (view to edit text)
{{=body}}