I would like to pass an additional argument in handling method GET in Python.
class Lista:
def GET(self):
try:
request = Request("")
response_body = urlopen(request).read()
decoded = json.loads(response_body)
return render.list(content = decoded, user = decoded[0])
except(ValueError, KeyError, TypeError):
print "JSON format error"
class Mail:
def GET(self):
request = Request("")
response_body = urlopen(request).read()
decoded = json.loads(response_body)
return render.mail(content = decoded, omail = decoded[0])
In class Lista downloading a list of objects from the Request URL and I render the HTML file "list". On the rendered page, I have a choice of several users. I would like to pass to the next class is what the user chose(by clicking).
Please help!
I think you need something like unless I misunderstood:
Now it accepts a optional variable
x
, variablex
is initialized toNone
just in case to need to send a empty request or so