Thursday, 8 August 2013

Passing variables to a function

Passing variables to a function

I have a module with a view function named 'edit' and a function named
'handle_upload'.
I would like to pass two variable values, which are available in the edit
function, to the handle_upload function, but I don't know how, since I
don't call the handle_upload function in the view function, so I can't
pass the values as parameters.
For clarity:
# my_module.py
def edit():
dynamic variable #1
dynamic variable #2
render_to_response(some_site.html, locals(), context_instance =
RequestContext(request))
def handle_upload():
# here is where I would want to get both variables.

No comments:

Post a Comment