forehead so:
  form=crud.create(db.comments)
  post=db(db.blog.id==request.args(0)).select().first()
  db.comments.post_id.default=post.id


    return dict(post=post,form=form)



       Ovidio Marinho Falcao Neto
                Web Developer
             [email protected]
          [email protected]
                 ITJP - itjp.net.br
               83   8826 9088 - Oi
               83   9334 0266 - Claro
                        Brasil




2012/12/2 jonas <[email protected]>

> Hi.
>
> when using the code below redirect and verification doesn't work:
>
> def comment():
>
>     """ create comment form """
>
>     post=db(db.blog.id==request.args(0)).select().first()
>     db.comments.post_id.default=post.id
>     form=crud.create(db.comments)
>
>     if form.process().accepted:
> session.flash = T('yes yes')
>         redirect(URL('index.html'))
>     else:
>     print "error"
> session.flash = T('no no')
> raise HTTP(400, "no form validation")
>
>     return dict(form=form)
>
> when I remove the if form... else... clause verification works but I don't
> have the redirect anymore:
>
> def comment():
>
>     """ create comment form """
>
>     post=db(db.blog.id==request.args(0)).select().first()
>     db.comments.post_id.default=post.id
>     form=crud.create(db.comments)
>
>     return dict(form=form)
>
> Have no clue why. please help.
>
> --
>
>
>
>

-- 



Reply via email to