Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
作者已删除此帖
我注意到代码没有说request.object.save(),这可能解释了为什么稍后检查时对象没有更改。
request.object.save()
但是 save 看起来很奇怪,因为这个函数在 save之后运行。这要么是浪费的,要么是无限循环的。由于目标是修改 request.object(刚刚保存的对象),然后在beforeSave().
beforeSave()
记得打电话response.success()或.error()结束beforeSave()。
response.success()
.error()