Re: [web2py] form in loop view

2011-05-23 Thread Miguel Lopes
On Mon, May 23, 2011 at 10:50 AM, Stifan Kristi < steve.van.chris...@gmail.com> wrote: > ... > === controller === > def blog_index(): > for i, row in enumerate(rows): >if i == items_per_page: break > >db.blog_comment.blog_id.default = row.id >form = crud.create(db.blog_

Re: [web2py] form in loop view

2011-05-23 Thread Stifan Kristi
thank you so much for your detail explaination and example miguel, i'm really appreciate it. i'll follow what you n massimo suggest to put the logic in the controlller. should i change it for example in the example before. e.g. from : === view === {{for i, row in enumerate(rows):}} {{if i == ite

Re: [web2py] form in loop view

2011-05-23 Thread Miguel Lopes
On Sun, May 22, 2011 at 9:02 AM, 黄祥 wrote: > hi, > > is it possible to use form in loop view? > > e.g. > {{for i, row in enumerate(rows):}} >{{if i == items_per_page: break}} > >{{db.blog_comment.blog_id.default = row.id}} >{{form = crud.create(db.blog_comment, >

Re: [web2py] form in loop view

2011-05-22 Thread Stifan Kristi
thank you so much for your replied marin, my intention is to show up blog comment form in the blog index, so that while the user see blog, they can comment it in 1 page. actually i have 2 form in blog index, 1 is for pass the hidden id when user click like. i just learn it from : http://web2py.com/

Re: [web2py] form in loop view

2011-05-22 Thread Marin Pranjic
Not sure if i understood, but if you have multiple forms, you can use SQLFORM with form.accepts(formname = 'form_'+str(i), ...) each form has it's own formname, so form.accepts will know which one is submitted. Is that your problem? On Sun, May 22, 2011 at 10:02 AM, 黄祥 wrote: > hi, > > is it pos

[web2py] form in loop view

2011-05-22 Thread 黄祥
hi, is it possible to use form in loop view? e.g. {{for i, row in enumerate(rows):}} {{if i == items_per_page: break}} {{db.blog_comment.blog_id.default = row.id}} {{form = crud.create(db.blog_comment, message = T('Record Inserted'))}} {{=DIV(form)}} {{p