Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从后端(python/Django)在模板上显示确认消息_Python_Angularjs_Django_Twitter Bootstrap - Fatal编程技术网

从后端(python/Django)在模板上显示确认消息

从后端(python/Django)在模板上显示确认消息,python,angularjs,django,twitter-bootstrap,Python,Angularjs,Django,Twitter Bootstrap,您好,我有一个JSONResponseMixin视图,该视图的主要功能是在用户在GUI中单击“确认”后将状态更改为“已确认”。我想显示一个弹出窗口,说明已确认。如何从django views.py中执行此操作 以下是我的看法 class ConfirmView(JSONResponseMixin, View): def post(self, request, *args, **kwargs): status = 'error' msg = "this i

您好,我有一个
JSONResponseMixin视图
,该视图的主要功能是在用户在GUI中单击“确认”后将状态更改为“已确认”。我想显示一个弹出窗口,说明已确认。如何从django views.py中执行此操作

以下是我的看法

class ConfirmView(JSONResponseMixin, View):

    def post(self, request, *args, **kwargs):
        status = 'error'
        msg = "this is from me"
        post_body = json.loads(self.request.body)
        fab_value = post_body['fab']
        mast_value = post_body['mast']
        comment = post_body.get('comment')

        try:
           object = Forecast.objects.get(fab=fab_value, mast=mast_value, type='XC')
        except ObjectDoesNotExist:
            object = []
        else:
            if object.status == 'notified(created)' or 'notified(updated)':
                object.status = 'confirmed'
                object.comment = second_po_comment
                object.confirm = self.request.user
                object.modified_by =User.objects.get(username=self.request.user.username)
                object.save()

        return self.render_json_response(dict(status=status, msg=msg))

您已经在向客户端发送
状态
消息
。用简单的html/css创建一个模式窗口并在其中显示消息怎么样?很好,Alix,但无法在我的项目中创建更多的html文件。您已经在向客户端发送
状态
消息
。用简单的html/css创建一个模式窗口并在其中显示消息怎么样?Alix很好,但是在我的项目中不能再创建html文件了。