阅读背景:

在django和ajax的视图函数中返回变量?

来源:互联网 

I need to populate an element with data from two variables depending on what the user selects from a list of choices. I have a view function that gets the table id from post (does it have to be post?) and returns additional information about that id from the table. So I need to get the two variables somehow from my view function to the template. The problem is how should I return it? by httprequest, render, or render_to_response and do I use the same template that I used to send the ajax data? I have seen tutorials that just returns httpresponse with one variable and no template, which just confuses me more than anything. Any help would be appreciated.I need to populate an element with data from tw




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: