0
# in views.py def start(request): initial_dictionary = {"abc":"abc"} request.session['123'] = "xyz" return initial_dictionary def post(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)

3
  • No, it's passed as a reference, not a pointer. Commented Dec 22, 2010 at 2:06
  • Are you sure in this case, it's passed as a reference? Commented Dec 22, 2010 at 2:10
  • 1
    Well, yes, because Python doesn't have pointers. Commented Dec 22, 2010 at 2:14

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.