so far, i have managed to do this:
def view():
postid = request.args(0)
post = db(db.post.id == postid).select()[0]
post.body = post.body.replace("\n", "<br />")
commentform = crud.create(db.comment, onaccept=_setPostId)
commentform[0].append(XML('<input type="hidden" name="post"
value="'+postid+'" />'))
return dict(post=post, commentform=commentform)
def _setPostId(form):
db(db.comment.id == form.vars.id).select()[0].update_record
(post=request.vars.post)
however as you can see, it sets the post for the comment after
inserting the comment despite the fact that the hidden post field has
a value inside the form which does not get posted. isn't this a bug? i
also should note that post field is not readable and writable.
thanks again.
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.