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.
--