Esempio n. 1
0
File: admin.py Progetto: areski/cwf
            def wrapped(request, obj, button):
                """We want to redirect back to the form regardless of what the view does"""
                # Do the normal view
                func(request, obj, button)

                # Find where to redirect to and go there
                if button.for_all:
                    url = AdminView.change_list(self.model)
                else:
                    url = AdminView.change_view(obj)
                return renderer.redirect(request, url, no_processing=True)
Esempio n. 2
0
            def wrapped(request, obj, button):
                """We want to redirect back to the form regardless of what the view does"""
                # Do the normal view
                func(request, obj, button)

                # Find where to redirect to and go there
                if button.for_all:
                    url = AdminView.change_list(self.model)
                else:
                    url = AdminView.change_view(obj)
                return renderer.redirect(request, url, no_processing=True)
Esempio n. 3
0
File: admin.py Progetto: areski/cwf
    def response_change(self, request, obj):
        """
            Change response to a change
            Redirects to a button if it has been set as a POST item
        """
        redirect = None
        for key in request.POST.keys():
            if key.startswith("tool_"):
                redirect = key

        if redirect:
            return renderer.redirect(request, redirect, no_processing=True)
        else:
            return super(ButtonAdmin, self).response_change(request, obj)
Esempio n. 4
0
    def response_change(self, request, obj):
        """
            Change response to a change
            Redirects to a button if it has been set as a POST item
        """
        redirect = None
        for key in request.POST.keys():
            if key.startswith("tool_"):
                redirect = key

        if redirect:
            return renderer.redirect(request, redirect, no_processing=True)
        else:
            return super(ButtonAdmin, self).response_change(request, obj)