db.select did the same, and so I checked the documentation, and
SQLForm also converts into a table.

So I did something more cleverish (I think?): for those who need to do
the same, the result will only work with db.select (maybe SQLForm, but
haven't tested). I created a for loop to grab just the rows, and set
it to another variable to be used within the textarea. The result is:

    for rows in db(db.t_problems.id==request.args(0)).select():
        k = rows.f_skeleton
    form = FORM(TEXTAREA(_id='problem_code',_name='solution',
value=k),
              INPUT(_type='submit'),  _action='', _method='post')


And it worked!

On Aug 6, 10:35 pm, Bruno Rocha <rochacbr...@gmail.com> wrote:
> I guess you have to replace crud.select with db.select
>
> Crud returns a form using tables by default unless you specify formstyle
> parameter.
>
> In your case. You probably need only data as a value. So use db.select not
> crud.select
>
> http://zerp.ly/rochacbruno
> Em 06/08/2011 23:45, "Hybride" <mshybr...@gmail.com> escreveu:
>
>
>
>
>
>
>
> > Hi everyone, am not sure if this intentional, but I've found something
> > curious (forgive me, if a repeat): when doing a crud.select for one
> > field in my controller, and putting it in a form's textarea, the
> > select is transformed into a table; however, if I simply print out the
> > result, I get it without a format.
>
> > data = crud.select(db.t_problems,
> > db.t_problems.id==db.t_problems(request.args(0)),
> > fields=['f_skeleton'], headers={'f_skeleton':''})
> > form = FORM(TEXTAREA(_id='problem_code',_name='solution',
> > value=data),
> > INPUT(_type='submit'), _action='')
>
> > My result:
>
> > <textarea><table><thead><tr><th></th></tr></thead><tbody><tr
> > class="even"><td>def hello():</td></tr></tbody></table></textarea>
>
> > If I do the print as such,
> > form = FORM(P(data),TEXTAREA(_id='problem_code',_name='solution',
> > value=''),
> > INPUT(_type='submit'), _action='')
>
> > My result (as it should be):
> > def hello():
>
> > Any idea as to why/how to get around this?

Reply via email to