重定向到管理员保存 [英] Redirect on admin Save
本文介绍了重定向到管理员保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在保存时将用户重定向到不同的应用?
How can I redirect a user to different app on Save?
我有两个应用程序,比如 app1
和 app2
.如果用户点击在 app2
中保存,那么它应该被重定向到 app1
而不是默认页面.
I have two app, say app1
and app2
. If a user clicks on Save in app2
then it should be redirected to app1
rather then the default page.
我不想做自定义表单.
推荐答案
def change_view(self, request, object_id,extra_context=None):
def change_view(self, request, object_id,extra_context=None):
result = super(mymodeladmin, self).change_view(request, object_id, extra_context)
result['Location'] = "your location"
return result
这篇关于重定向到管理员保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文