options.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:liberator 作者: libscie 项目源码 文件源码
def _get_obj_does_not_exist_redirect(self, request, opts, object_id):
        """
        Create a message informing the user that the object doesn't exist
        and return a redirect to the admin index page.
        """
        msg = _("""%(name)s with ID "%(key)s" doesn't exist. Perhaps it was deleted?""") % {
            'name': force_text(opts.verbose_name),
            'key': unquote(object_id),
        }
        self.message_user(request, msg, messages.WARNING)
        url = reverse('admin:index', current_app=self.admin_site.name)
        return HttpResponseRedirect(url)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号