Hi there,

Maybe I just misunderstood the online book, but I would like to solve my
doubts about this:
In chaper #07, speaking about the CRUD method *ondelete*, the book says:

ondelete is called in place of onaccept when a record is deleted via an
> "update" form.
>

I added both to my *crud.update*, in this way:

form = crud.update(db.news, db(db.news.id==newsId).select().first(),
> onaccept=lambda form: utilities.update_history(form, T('edited the news'),
> session, auth.user.username), ondelete=lambda form:
> utilities.update_history(form, T('deleted the news'), session,
> auth.user.username))
>

The odd thing is that in case of deletion, *ondelete* and *onaccept* seem
to be both fired.
Is that supposed to be so?
What if in case of deletion I need to fire just *ondelete*?

Best,
David

-- 



Reply via email to