重定向在管理员保存

编程入门 行业动态 更新时间:2024-10-26 10:37:07
本文介绍了重定向在管理员保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

$ 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

更多推荐

重定向在管理员保存

本文发布于:2023-10-31 18:33:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546924.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   管理员

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!