本文介绍了重定向在管理员保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ p
我有两个应用程序,例如 app1 和 app2 。如果用户点击 app2 中的保存,则应将其重定向到 app1 ,而不是默认页面。
我不想做一个customform。
解决方案def change_view自我,请求,object_id,extra_context =无):
result = super(mymodeladmin,self).change_view(request,object_id, result ['Location'] =你的位置 返回结果
How can I redirect a user to different app on Save?
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.
I don't want to do a customform.
解决方案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
更多推荐
重定向在管理员保存
发布评论