In this line from Using Images Python API
http://code.google.com/appengine/docs/python/images/usingimages.html#Serving
greeting = db.get(self.request.get("img_id"))
in
class Image (webapp.RequestHandler):
def get(self):
greeting = db.get(self.request.get("img_id"))
if greeting.avatar:
self.response.headers['Content-Type'] = "image/png"
self.response.out.write(greeting.avatar)
else:
self.response.out.write("No image")
Where does the "img_id" come from? The documentation says:
We'll need to update the HTML of the Guestbook to pass the key of the
greeting to the Image handler
and gives these lines:
self.response.out.write("<div><img src='img?img_id=%s'></img>" %
greeting.key())
self.response.out.write(' %s</div>' %
cgi.escape(greeting.content))
Can you please explain how img_id is passed from MainPage handler to
Image handler? I am confused about what is happening here. Thanks?
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.