开发者

Will this make changes to "request", in Django?

# in views.py

def start(request):
    initial_dictionary = {"abc":"abc"}
    request.session['123'] = "xyz"
    return initial_dictionary


def post开发者_C百科(request):
    dictionary = start(request)
    return render_to_response("blah")

This is OOP. Will this make changes to "request", and will the session be set? (request is passed as a pointer)


The session object comes from the HttpRequest, so if that's what gets passed into the function as request then what you have should work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜